Hello, I imported an excel spread sheet that has a macro that when clicked refreshes a pivot table. The button does not work in Libre and I have tried to recreate it using the record macro feature but I can’t get it to work
The following is a copy of my macro contents. Using Cal version 4.4.0.3
Thanks in advance for your help. I have an assignment that needs to be handed in on Monday morning and this is holding me back.
sub Update_Data
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 = “Nr”
args1(0).Value = 4
dispatcher.executeDispatch(document, “.uno:JumpToTable”, “”, 0, args1())
rem ----------------------------------------------------------------------
dim args2(0) as new com.sun.star.beans.PropertyValue
args2(0).Name = “ToPoint”
args2(0).Value = “$B$34”
dispatcher.executeDispatch(document, “.uno:GoToCell”, “”, 0, args2())
rem ----------------------------------------------------------------------
rem dispatcher.executeDispatch(document, “.uno:RecalcPivotTable”, “”, 0, Array())
end sub