zde je zkopírované vše co mám v makrech. datum se nedá vůbec spustit ani přes správce maker. Kolo jde spustit jen přes správce maker. Zkoušel vše v makrech odstranit, nepomohlo to. nyní jak klepnu na ikonu spustit makro, hned se zavře celý program libre.
REM ***** BASIC *****
Sub Main
End Sub
REM ***** BASIC *****
Sub ZapisDatum 'zapise datum zadane datumovym polem do bunky s kurzorem
dim oDoc, oSelect as object
dim Result, shtname, DatPole as string, sht as integer
DatPole = "datum1" ' nazev ve vlastnostech datumoveho pole musi souhlasit
oDoc = ThisComponent
oSelect=oDoc.CurrentSelection.getRangeAddress
'oBrowser(oDoc.CurrentSelection.getRangeAddress)
sht=oSelect.Sheet ' index listu s kurzorem
shtname=oDoc.sheets(sht).name 'jmeno listu
oDatum = oDoc.Sheets(sht).DrawPage.Forms(shtname).getByName(DatPole) ' odkaz na datumove pole
'oDatum.HelpText="Zadejte nebo vyberte datum které bude vloženo na místo kurzoru."
Result= oDatum.text
On Local Error GoTo NODOCUMENTTYPE ' ignoruje chyby - např nesmyslne zadane datum
' zapsat do bunky na ktere je kurzor.
if result <> "" then
oDoc.sheets(sht).getCellByPosition(oSelect.StartColumn,oSelect.StartRow).Value = dateValue(Result)
else
oDoc.sheets(sht).getCellByPosition(oSelect.StartColumn,oSelect.StartRow).string = ""
end if
exit sub
NODOCUMENTTYPE:
beep
End Sub
sub kolo
rem ----------------------------------------------------------------------
rem define variables
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")
rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "StringName"
args1(0).Value = "100"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = "ToPoint"
args2(0).Value = "$E$7"
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args2())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "StringName"
args3(0).Value = "50"
dispatcher.executeDispatch(document, ".uno:EnterString", "", 0, args3())
rem ----------------------------------------------------------------------
dim args4(1) as new com.sun.star.beans.PropertyValue
args4(0).Name = "By"
args4(0).Value = 1
args4(1).Name = "Sel"
args4(1).Value = false
dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args4())
end sub