Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello everyone,
thank you very much for the support so far here. You are great.
I have so far managed using a macro to export a table. However, these data should be filtered before export it, best also via Macro. Does anyone know of a way? The approaches presented here have not yet brought me to the destination.
Thank you for your help.
Kind regards,
Chris
My previous macro:
Sub exportToExcel
set obj = ActiveDocument.GetSheetObject("CH695_903948695")
obj.ExportEx "E:\SASCHA_Export\test.xls", 5
msgbox("Export successfully completed.")
end sub
Use a Select in Field action to make the selection and add that action to the same object you added the Run Macro action. Make sure the Select in Field action is placed above the Run Macro action so that the selection is made before the macro is executed.
Yes u're right. I already tried this. But unfortunately it doesn't work.
See here my code:
Sub exportToExcel
ActiveDocument.Fields("# GPartner").Select "=2"
set obj = ActiveDocument.GetSheetObject("CH695_903948695")
obj.ExportEx "E:\SASCHA_Export\test.xls", 5
msgbox("Export successfully completed.")
end sub
I got following errormessage => Object required: 'ActiveDocument.Fields(...)'
"# GPartner" is the description from the exporting table.
Kind regards,
Chris
You need to delete the equal sign:
ActiveDocument.Fields("# GPartner").Select "2"
Nothing happens except the error already described.
Also tried another column without the "#" and another value.