grazieeeeeeeeeeeee funzionaaaaaaaaaaaaa :-))))

estratta dalla tua, scrive le righe di un file di testo in una tabella
di calc
perfetto

l'ho provata anche con un file ods ma mi da un macello, come si accede
alle celle di un file ods senza aprirlo??

sub InsertFile
  dim oUcb as object
  dim oFile as object
  DIM oInputStream as object
  dim sNomeFile as STRING
  dim sRiga(100)
  Dim oSheet as Object
  dim i as integer
  dim u as integer
   Dim oSheet2 as object
   Dim oCell2 as object
 
  oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
  oInputStream = createUnoService("com.sun.star.io.TextInputStream")
  sNomeFile = ConvertToUrl("/home/pla/ooo-dati.txt")
  oFile = oUcb.OpenFileReadWrite(sNomeFile)
  oInputStream.SetInputStream(oFile.GetInputStream())
 

  for u = 0 to 100
      sRiga(u) = oInputStream.readLine(u)
      oSheet2 = ThisComponent.Sheets.getByIndex( 0 )
    oCell2 = oSheet2.GetCellByPosition( 0, u)
    oCell2.String = sRiga(u)
  next u
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Rispondere a