Hello, all. I have a Calc document which displays the time [NOW(); formatted as HH:MM:SS] and the weather [external link to forecast.weather.gov]. I am hitting F9 to recalculate for the current time and going to Edit > Links to External Files… > Update in order to update the temperature. I would like to create a macro to do both tasks and link it to a button which I will create using Form Controls.
I enabled Record Macro to create the macro and got this:
sub update
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 ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:Calculate", "", 0, Array())
rem ----------------------------------------------------------------------
dispatcher.executeDispatch(document, ".uno:EditLinks", "", 0, Array())
end sub
This resulted in the time updating, the requester for Edit Links appearing on the screen, and nothing else.
I have upgraded to 6.3.6.2 based on other question resolutions I have seen here; now the macro does nothing at all.
Macro Security has been temporarily downgraded to Low, and I have designated the containing folder of the Calc document (which is my Windows 10 Desktop) as a Trusted Source under Macro Security.
Any assistance would be appreciated. Thanks.