Skip to main content

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
CUSTOMERS ONLY: Now accepting customer applications for the 2023 Luminary Program: SUBMIT NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
anselmo_meira
Creator II
Creator II

Export table from load script to Excel

Hi all,

I would like to know if it is possible to export data from load script to an excel file as can be done with qvd.

If it is possible, can you provide some examples?

Thanks in advance.

1 Solution

Accepted Solutions
santiago_respane
Specialist
Specialist

You can store in csv format in order to load it from excel (1), or you can have a table box in a hidden sheet with the data you want to export and run a macro that exports to excel after the script runs (2).

1-Store command:

STORE YourTableName into YourFile.csv (txt);


2-Macro:

sub Export

  on error resume next

  Set obj = ActiveDocument.GetSheetObject("ID OF THE TABLE TO EXPORT")

  vPath = "Path to the excel file"

  vName = "Name of the excel file"

  set filesys=CreateObject("Scripting.FileSystemObject")

  If Not filesys.FolderExists(vPath) Then

    Set newfolder = filesys.CreateFolder(vPath)

  End If

  obj.ExportBiff vPath & vName

  Set obj = nothing

end sub

Hope this helps.

Kind regards,

View solution in original post

5 Replies
trdandamudi
Master II
Master II

You can export to .txt file and then you can open in Excel.

store MyData into Samplefile.txt (txt);

santiago_respane
Specialist
Specialist

You can store in csv format in order to load it from excel (1), or you can have a table box in a hidden sheet with the data you want to export and run a macro that exports to excel after the script runs (2).

1-Store command:

STORE YourTableName into YourFile.csv (txt);


2-Macro:

sub Export

  on error resume next

  Set obj = ActiveDocument.GetSheetObject("ID OF THE TABLE TO EXPORT")

  vPath = "Path to the excel file"

  vName = "Name of the excel file"

  set filesys=CreateObject("Scripting.FileSystemObject")

  If Not filesys.FolderExists(vPath) Then

    Set newfolder = filesys.CreateFolder(vPath)

  End If

  obj.ExportBiff vPath & vName

  Set obj = nothing

end sub

Hope this helps.

Kind regards,

anselmo_meira
Creator II
Creator II
Author

Thanks santiago.respaneIt worked perfectly.

yrstruly
Contributor
Contributor

Im Getting an error file not found and cant open file.Pls assist?

gareth_muir
Contributor II
Contributor II

My file just comes out as 'file' - i can right click and open in excel and it opens ok but i'd like to be able to export a clean xls or xlsx, any ideas on how to alter the macro to do that?