Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to export three straight tables in a xls (Excel) file

Dear all,

I have three tables (straight tables) on a sheet of my application which have the same structure with the same columns. Only values are differents between my three tables :

- in my first table I have detailled values

- in my second table I have aggregated values

- in my third table I have only one total line of my 2 first tables

I wanted to know if it's possible to create a button for example which would send the three tables in Excel ?

By a macro maybe ?

Thanks in advance for your help,

Benjamin

2 Replies
Gysbert_Wassenaar

See here


talk is cheap, supply exceeds demand
Not applicable
Author

here is Export CSV and HTML:




'======================Script - Export====================

set obj = ActiveDocument.GetSheetObject("CH308")

set UM = ActiveDocument.Variables("UMS")

u= UM.getContent.string






Obj.Export "\\RLqlikview\echt\TEMP\"& "Umsatz" & ".csv",";"

Obj.ExportHTML ("\\RLqlikview\echt\TEMP\" & "Umsatz_Gesamt" & ".html")





set obj = ActiveDocument.GetSheetObject("CH306")

Obj.Export "\\RLqlikview\echt\TEMP\"& "Umsatz" & ".csv",";",, TRUE

Obj.ExportHTML ("\\RLqlikview\echt\TEMP\"  &  "Umsatz_FOC-Retail" &".html")



set obj = ActiveDocument.GetSheetObject("CH307")

Obj.Export "\\RLqlikview\echt\TEMP\"& "Umsatz" & ".csv",";",, TRUE

Obj.ExportHTML ("\\RLqlikview\echt\TEMP\"  &  "Umsatz_Alles" & ".html")