Per favore se cè a disposizione qualche esperto perchè devo finire la cosa entro la prossima settimana!
io pacioccando sono riuscita a ricavare l'ultima data ma funziona 8non so come mai) se ho un foglio solo... con piu fogli , non capisco la motivazione, non va e pesca sempre le date del primo foglio nonostante io abbia messo come foglio attivo il nome del foglio che mi serve. Come vedrete ci sono molto pasticci nel codice perche non ho la minima idea di come si usi. Vado ad intuito copiazzando di qua e di là codici sul web...
aiuto please!!
codice:
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$E$15"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
'dim args6(0) as new com.sun.star.beans.PropertyValue
'args6(0).Name = "StringName"
'args6(0).Value = "='" & nomefoglio &"'.j16" ' DA CHANCE IN BASE A ULTIMA DATA - VEDI FORUM ------------------------------------------------------
'dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args6())
rem ----------------------------------------------------------------------
'dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())
'----parte per ultima data ---------------------------------------------------------------
oCalcDocument = ThisComponent
oSheets = oCalcDocument.getSheets()
oSheet = oSheets(nomefoglio)
thiscomponent.currentcontroller.activesheet = _
thiscomponent.sheets.getbyname(nomefoglio)
GetSheetName = ThisComponent.getCurrentController.getActiveSheet.getName()
msgbox getsheetname
oSheet_Tabelle = thiscomponent.sheets.getbyname(nomefoglio)
THISCOMPONENT.CurrentController.setActiveSheet(oSheet_Tabelle)
thiscomponent.currentcontroller.activesheet = _
thiscomponent.sheets.getbyname(nomefoglio)
' msgbox ocell.string & "1-" & nomefoglio
FOR I=6 TO 15
thiscomponent.currentcontroller.activesheet = _
thiscomponent.sheets.getbyname(nomefoglio)
oSheet = oSheets(nomefoglio)
oCell = oSheet.getCellByPosition(9, I) ' CICLO
msgbox ocell.string
IF OCELL.string = "" then
msgbox ocell.string
'i=i+1
'else
'msgbox "cella vuota " & i
oCell = oSheet.getCellByPosition(9, I-1)
msgbox ocell.string & " ultimo " & nomefoglio
exit for
end if
next
thiscomponent.currentcontroller.activesheet = _
thiscomponent.sheets.getbyname("RIPARTO FRUTTI")
'------------------------------------------------------------------------
rem ----------------------------------------------------------------------
dim args6(0) as new com.sun.star.beans.PropertyValue
args6(0).Name = "StringName"
'args6(0).Value = "='" & nomefoglio &"'.j16" ' DA CHANCE IN BASE A ULTIMA DATA - VEDI FORUM ------------------------------------------------------
args6(0).Value = ocell.string
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args6())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:JumpToNextCell", "", 0, Array())