Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have to export an Object with ID LB04 in excel when one presses a button. I tried this VBscript:
sub excelExport
set XLApp = CreateObject("Excel.Application")
XLApp.Visible = FALSE
set XLDoc = XLApp.Workbooks.Add
XLDoc.Sheets(1).name = "Supervisor Report"
set XLSheet = XLDoc.Worksheets(1)
set MyTable = ActiveDocument.GetSheetObject("LB04")
set XLSheet = XLDoc.Worksheets(1)
MyTable.CopyTableToClipboard true
XLSheet.Paste XLSheet.Range("A1")
XLDoc.SaveAs "C:\path\to\my\folder\BI\data.xlsx"
XLApp.Visible = False
XLApp.Quit
Set XLApp = Nothing
Set Table = Nothing
end sub
It does not work. How can I solve?
Try to use this function: