Hi I have an application, where 2 Straight Table. I want to export the both straight table data in Single Excel but in sheet1 and Sheet 2.
Macro is working but it is not exporting CH01 object data, In both sheet CH02 data is coming.
Below is my code :
Sub ExcelFile
DIM ExcelApplication, ExcelWorkbook
SET ExcelApplication = CREATEOBJECT("Excel.Application")
SET ExcelWorkbook = ExcelApplication.Workbooks.Add
SET MyExcelApp = Nothing
ActiveDocument.GetSheetObject("CH01").CopyTableToClipBoard TRUE
ActiveDocument.GetSheetObject("CH02").CopyTableToClipBoard TRUE
ExcelWorkbook.Worksheets(1).Paste
ExcelWorkbook.Worksheets(2).Paste
ExcelApplication.DisplayAlerts = FALSE
ExcelWorkbook.SaveAs "C:\Users\User\Downloads\test.xls",56
ExcelApplication.Quit
MsgBox "Export Complete"
End Sub
I am also attaching my QVW.
Please do the needful. Thanks in advance.
Regards,
AK