Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I have next code which open new excel file and add data. I need to modife my code to export data to existing excel file.
sub ExportChart
set cs = ActiveDocument.GetSheetObject("TX01")
set XLApp = CreateObject("Excel.Application")
XLApp.Visible = True
set XLDoc = XLApp.Workbooks.Add
XLDoc.Sheets(1).name = "Exported text object" set
XLSheet = XLDoc.Worksheets(1)
XLSheet.Range("A1") = cs.GetText()
End Sub
Any idea?
Hi,
I am not a VBS expert but,
sub ExportChart
set cs = ActiveDocument.GetSheetObject("TX01")
set XLApp = CreateObject("Excel.Application")
XLApp.Visible = True
Set XLDoc = XLApp.Workbooks.Open("C:\test.xls")
XLDoc.Sheets(1).name = "Exported text object" set
XLSheet = XLDoc.Worksheets(1)
XLSheet.Range("A1") = cs.GetText()
End Sub
Aurélien