Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I have a Straight Table (the chart may change in future to Pivot or Table Box etc etc) with some data. I Need to Export the data into a Text File but with some conditions:
What could be the Macro script for this to be used by a Button. Please help with some examples.
Regards!
Hi
In order to achieve this just right on the object select export
Select the file format as comma delimited csv,txt.
Save the file with.txt extension.
Hope it help.
Regards
ASHFAQ
Thanks.
Am New to Macro.
could you please show me how?
Hi,
My solution was not using macros.
If you need macro.
please find the below code.
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("TB04")
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
Hope it help.
Regards
ASHFAQ