I have two calc macros with similar code structure that are now both generating “Basic runtime error Variable not defined”. I’m wondering whether this might have happened after a LO update? I can’t think of any other reason, since nothing as far as I can recall has changed. I don’t remember whether my LO has updated recently (or whether it does so automatically).
Here’s the code (the error occurs on the last line shown):
Dim oDoc As Object
Dim sUrl As String
Dim oTargetDoc As ObjectoTargetDoc= ThisComponent Rem TargetDoc is the spreadsheet you are working from
Dim Prop(0) as New com.sun.star.beans.PropertyValue
Prop(0).name=“FilterName”
Prop(0).value=“MS Excel 97”
sUrl = convertToURL(“c:\Backup\oc\invts\portfolio.xls”)if fileExists(sUrl) then
oDoc = stardesktop.LoadComponentFromURL(sUrl, “_blank”,0, Prop())
else
msgbox “Not found”
end ifRem copy the relevant data up to row 100 and paste it into target doc
oSheet = oDoc.Sheets.getByName(“trades”) Rem oDoc is portfolio.xls
Anybody had a similar experience/ guess what might be happening here?