Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How do I create a VBscript to export data from a sheetobject to .CSV file

Hello All,

I've not done much vbscripting, so I'm looking for some code snippets for a macro which exports data from a sheet object to a .CSV file. There is the export option by right clicking on the object but we would like to be able to do this via a Button; and if possible let this process run in the background thus allowing the user to still use the tool while exporting very large data set. Any suggestions would be appreciated.

4 Replies
Not applicable
Author

Okay, I've manage to create a button to export to .CSV, I had a the wrong Objectid in the getsheet object call. My second question, is it possible to run the download as separate process or background process using the vbscripting language? The files that we are exporting are quite large and time consuming. I'm thinking the data is locked so that no changes occurr to the data while the export is in progress so it may not be possible. Any thoughts on this will be appreciated.

Nadir

Anonymous
Not applicable
Author

Nadir,

I don't have an answer to your questions but would appreciate seeing your code for exporting to a text file from a button.

Regards,

John.

Not applicable
Author

John,

Here is the code I used to export to a .CSV file :

Sub SR37
'Download Sheet ojbect data to CSV
set sObject = ActiveDocument.GetSheetObject("CH24")
sObject.Export "C:\TEST.CSV",","
End Sub

I use a button object to trigger this subroutine.

Nadir

Anonymous
Not applicable
Author

Nadir,

thanks for this.

John.