Page 1 of 1

[Solved] "OpenMacroEditor" doesn't work after OO-update !?

Posted: Thu Jan 29, 2009 10:13 am
by onidarbe
Hi,
I had a very nice macro assigned to a toolbar-button to open my OO-basic macro 'Module1' in 1 click.
Now after updating OO 2.4 to 3.0.1 it doesn't work anymore :(
It opens the macro editor, but not Module1.

Does anyone know why?

Code: Select all

sub sOpenMacroEditor 'Assigned to a button to speed up opening the macro editor in this code.
   'to assign it to a button: ooCalc/Tools/Customize/ToolBars/Add.../OpenOffice.org Macros/ThisFilename/Standard/Module1/sOpenMacroEditor/Add
   dim aOptions(5) as New com.sun.star.beans.PropertyValue
   aOptions(0).Name="LibName": aOptions(0).Value="Standard"   'Name of library
   aOptions(1).Name="Name": aOptions(1).Value="Module1"   'Name from Module or Dialog
   aOptions(2).Name="Line": aOptions(2).Value=440   'Linenumber to set the cursor. NOTE: I which I could go to the last cursor or a marker...
   aOptions(3).Name="Type": aOptions(3).Value="Module"   'Module or Dialog
   aTemp=split(ConvertFromURL(ThisComponent.GetURL),"\")
   aTemp=split(aTemp(uBound(aTemp)),".")   'Get filename
   aOptions(4).Name="Document": aOptions(4).Value=aTemp(0)   'Name of the document = filename without extention
   oFrame = CreateUnoService("com.sun.star.frame.Frame")
   oDispatchHelper = createUnoService("com.sun.star.frame.DispatchHelper")
   oTemp = oDispatchHelper.ExecuteDispatch(oFrame, ".uno:BasicIDEAppear" ,"" ,0 ,aOptions())
end sub

Re: "OpenMacroEditor" doesn't work after OO-update !?

Posted: Thu Jan 29, 2009 1:24 pm
by B Marcelly
Hi,
I have also discovered that this trick does not work any more.
If I remember correctly, it is because the name of the window title of the Basic IDE has changed.
So this dispatch option is useless because it depends on OOo version.
______
Bernard

Re: "OpenMacroEditor" doesn't work after OO-update !?

Posted: Thu Jan 29, 2009 10:52 pm
by onidarbe
As long as there isn't an other solution to go quickly to the programcode, it's not entirely useless. Because you only need it in development of the total code.

Question now is how to solve it now for this 00-version...

Re: "OpenMacroEditor" doesn't work after OO-update !?

Posted: Sun Feb 08, 2009 3:36 pm
by onidarbe
One could just make a program error to open the macro-editor and get to that line.
Assign a button to that sub with an error in it:
ooCalc/Tools/Customize/ToolBars/Add.../OpenOffice.org Macros/ThisFilename/Standard/Module1/sOpenMacroEditorHere/Add

Code: Select all

sub sOpenMacroEditorHere 'Assigned to a button to speed up opening the macro editor in this code.
   thisComponent.makeError
end sub

Can't we use VbScript macro in open office in linux platform

Posted: Wed Feb 11, 2009 8:45 am
by bharatsatyal
Hi,
I was using windows and migrated to Ubuntu. Now i want to use macros of excel in open office spreadsheet but I could not use. The macro was written in VbScript. Can anyone help me to resolve this problem.
Thank you