Hi All,
Is it possible to run a single macro for all excel files and if so how. The macro scales the excel file to fit to single page. After which I plan to convert it to pdf using lo cli.
Currently the macro is inside the “My Macros and Dialog - > Standard → Module1 → Main”. The conversion to pdf through lo cli works fine only for one document through which I saved the macro. I am looking for something that helps me to run the same macro for all files via cli.
Libre office version: 6.0.6
Macro has been recorded with libreoffice and can be seen below:
REM ***** BASIC *****
sub Main
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
vrem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:PageFormatDialog", "", 0, Array())
end sub