Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
mahendragaur
Creator
Creator

Macros in QlikView

Hello Experts,

I want to save straight table in .csv format at location "C:\ChartData.csv", ", ". I'm using below script but only getting msg "macro running" at bottom left corner and also my application is getting hang-

sub abc

set sObject = ActiveDocument.GetSheetObject("CH26")
sObject.Export "C:\ChartData.csv", ", "

end sub

Please let me know how can I save straight table at mentioned location.

11 Replies
hector_munoz
Specialist
Specialist

Hi Gaur,

I usde the following macro and it works fine:

Sub ExportToFile

set sObject = ActiveDocument.GetSheetObject("CH01")

sObject.Export "C:\TestFile.csv", ", "

End Sub

Ensure you are using the proper objetc ID and the path exists, and those things...

Regards,
H

krishnacbe
Partner - Specialist III
Partner - Specialist III

Hi

Limit the data in straight table and check the export and validate the paths.

As you are trying to save the file C Drive it might have some access issue, try different location.

mahendragaur
Creator
Creator
Author

There is no access issues to save file in C drive and also in file there are only 850 rows and 5 columns but yeah no. of rows varies and it may be more than this. Also, when I'm using some other file with less data, it is getting updated successfully at the same location. So, my question is "Is there any other way to save the data or in some other format"?

mahendragaur
Creator
Creator
Author

Hello Hector,

Everything is correct like Object ID, path and script as well. Any other suggestion apart from this will be helpful.

Thank you

hector_munoz
Specialist
Specialist

Cpuld you attach a (reduced) sample of your application?

mahendragaur
Creator
Creator
Author

I can't attach the data here because it is the confidential data. Could you please let me know the other format in which I can save data of straight table.

Miguel_Angel_Baeyens

If it is an object what you want to save, check the API options for that (like Excel, PPT, etc.) to see which other formats are allowed.

If it is a table from the script, you can STORE into CSV files.

mahendragaur
Creator
Creator
Author

I want to save whole data of straight table

Miguel_Angel_Baeyens

How big is that table and how much CPU and RAM resources do you have in the computer running the macro?