In Base I create a calc-sheet with the following code
Dim oHidden(0) As New com.sun.star.beans.PropertyValue
oHidden(0).Name = "Hidden"
oHidden(0).Value = FALSE
oDBDoc=StarDesktop.loadComponentFromURL("file:///home/Affarssystem/Report/Statusreport.ots", "_blank", 0, oHidden())
sheet=oDBDoc.sheets.getByIndex(0)
sheet.getCellByPosition(1,0).String="Statusreport "
Dim Props()
PathDoc = ConvertToURL("file:///home/prm/Affarssystem/Statustest.ods")
oDBDoc.storeAsURL(PathDoc, Props())
Statusreport.ots is an empty file except for one button connected to a macro that email a pdf-copy of the calc-sheet to a recipent.
After I edit in some comments in the calc-sheet I push the button in order to email the pdf-copy but the macro never activates. If I close the document and reopen it everything works like a charm and the macro emails the pdf-copy.
Tried with oDBDoc.release() but only get Basic runtime error.
Do someone smarter than me understand what’s preventing running a macro in the calc-sheet until you close and reopen.