questo è quello che ho combinato fino ad ora...
su un foglio solo funziona ma se ho piu fogli mi da errore su dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args6())
e mi dice sequence element is not asignable by given value... aiutatemi! devo finirlo entro oggi pomeriggio!
codice:
SUB DISTINTA
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$A$14"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
dim OBJSTS as object ' VAR. OGGETTO x INSIEME SHEETS
dim IDSH as integer ' VAR. NUMERICA x CONTEGGIO SHEETS
dim NMSH as string ' VAR, PER NOME SHEET DI CICLO
OBJSTS = thiscomponent.sheets ' ACQUISISCO OGGETTO INSIEME SHEETS
for IDSH = 0 to OBJSTS.count - 5 ' CICLO SU CONTEGGIO SHEETS
NMSH = OBJSTS.getbyindex(IDSH).name ' SCRIVO NOME SHEET DI CICLO IN VAR.
oCalcDocument = ThisComponent
oSheets = oCalcDocument.getSheets()
oSheet = oSheets(idsh)
oCell = oSheet.getCellByPosition(1, 6) ' b7
msgbox "Prova contenuto b7 fogli: " & ocell.string & " " & idsh
thiscomponent.currentcontroller.activesheet = _
thiscomponent.sheets.getbyname("DISTINTA")
'------------------------------------------------------------------------
rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "StringName"
args6(0).Value = ocell.string
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args6())
next IDSH ' CHIUDO CICLO SU ELENCO SHEETS
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())
END SUB