von martin1234 » Di, 18.03.2008 18:55
Hallo Leute
ich möchte anfangen ein Makro zu erstellen, da ich absolut neu bin, wollte ich erstmal eine ganz einfache funktion implementieren:
eine Zelle kopieren und sieben spalten weiter einfügen:
sub autoCopy
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 = "ToPoint"
args1(0).Value = ActiveCell
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "ToPoint"
args3(0).Value = ActiveCell.Offset(0,7)
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
end sub
bedauerlicherweise funktioniert der offset nicht, ich erhalte eine fehlermeldung, dass die objektvariable nicht belegt ist!
jemand eine idee?
wäre dankbar
beste grüße
martin
Hallo Leute
ich möchte anfangen ein Makro zu erstellen, da ich absolut neu bin, wollte ich erstmal eine ganz einfache funktion implementieren:
eine Zelle kopieren und sieben spalten weiter einfügen:
sub autoCopy
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 = "ToPoint"
args1(0).Value = ActiveCell
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args1())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Copy", "", 0, Array())
rem ----------------------------------------------------------------------
dim args3(0) as new com.sun.star.beans.PropertyValue
args3(0).Name = "ToPoint"
args3(0).Value = ActiveCell.Offset(0,7)
dispatcher.executeDispatch(document, ".uno:GoToCell", "", 0, args3())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Paste", "", 0, Array())
end sub
bedauerlicherweise funktioniert der offset nicht, ich erhalte eine fehlermeldung, dass die objektvariable nicht belegt ist!
jemand eine idee?
wäre dankbar
beste grüße
martin