Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
So Can we execute both the Macros at a time and Can we get Output as attached.
Macro 1 -
sub Export
set XLApp = CreateObject("Excel.Application") ' Define Object
XLApp.Visible = True 'Visible set as true
set XLDoc = XLApp.Workbooks.Add 'Open new workbook
set table = ActiveDocument.GetSheetObject("CH03")
rem set table = ActiveDocument.GetSheetObject("MB01")
set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted
table.CopyTableToClipboard true 'Copy data to Clipboard
XLSheet.Paste XLSheet.Range("A1") 'Paste data into cell
end sub
Macro 2 -
sub Export1
set XLApp = CreateObject("Excel.Application") ' Define Object
XLApp.Visible = True 'Visible set as true
set XLDoc = XLApp.Workbooks.Add 'Open new workbook
set XLSheet = XLDoc.Worksheets(1) 'Select sheet where data should be pasted
XLSheet.Range("A1").Value ="Total Exposure Amount Total Test "
end sub