1 Reply Latest reply: Jul 30, 2013 7:22 AM by Marcus Sommer RSS

    Export to CSV Macro

      Hi all,

       

      I have straight table objects with ID's: "HPA", "RBM", "Listing".

       

      I'm trying to write a macro which exports these tables in csv format, into folders I specify.

       

      Object "HPA" and "RBM" are in a Container Object. If table "HPA" is not selected in that container, the first part of the code will not work. Similarly if "RBM" is not selected in the container the Object2 part will not work.

       

      Has anybody got any tips on how to overcome this?

       

      Thanks

      Adam

       

      The code I am using is below:

       

      Sub ExportToFile

       

      set sObject1 = ActiveDocument.GetSheetObject("HPA")

       

      sObject1.Export "\\S32020\shared$\Operations\MI\02 Data\Qlikview\Sales\SL_HPA_Summary.csv", ", "

       

      set sObject2 = ActiveDocument.GetSheetObject("RBM")

       

      sObject2.Export "\\S32020\shared$\Operations\MI\02 Data\Qlikview\Sales\SL_RBM_Summary.csv", ", "

       

      set sObject3 = ActiveDocument.GetSheetObject("Listing")

       

      sObject3.Export "\\S32020\shared$\Operations\MI\02 Data\Qlikview\Sales\SL_Listing.csv", ", "

      End Sub