I am creating a LotusScript script which creates an Excel file with embedded objects. But when I come to actually embed the PDF file I get "Unable to get the Add property of the OLEObjects class". Unfortunately Lotusscript can't deal with named arguments, so I have to hand over all arguments in the correct order. Not sure if I might leave out trailing optional arguments.
tempdir = "c:\data\temp"
pdfname = "20140826-32051-1890459257-300-421425-GRF.pdf"
Set xlApp = CreateObject("Excel.Application")
xlApp.Workbooks.Add
Set xlsheet = xlApp.Workbooks(1).Worksheets(1)
Set oleObjs = xlsheet.OLEObjects
Set oleObj = OLEObjs.Add("", tempdir + "\" + pdfname, False, _
True, "", "", pdfname, _
"","","","")
'Arguments: ClassType, FileName, Link,
'DisplayAsIcon, IconFileName, IconIndex, IconLabel,
'Left, Top, Width, Height