Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
As a part of automating some QA processes I want to export some objects (their data of course) from my UI to csv files while the loading script executes. is that possible?
Also, is it possible when doing the reload phase, to use the macros to generate several selections on some filters and then make the export above?
Thanks,
Boris
Try this macro
SUB ExportChartToCSV
Dim myCharts(2)
myCharts(0) = "Coat"
myCharts(1) = "Suit"
myCharts(2) = "Boxes"
For Each item In myCharts
SET objChart = ActiveDocument.GetSheetObject(item)
objChart.Export "C:\" & item & ".CSV", ", "
Next
END SUB
Regards,
Jagan.
Verify STORE command on first point. Edit Script is synchronous process not asynchronous.
One Second point inside I don't understand what is the real question.
No, it is not possible to access any UI objects during the load script. The ActiveDocument object, which is required to access any sheet objects, does not exist during the load.
Rob
Hi,
It is not possible to process the UI objects during script reload, what you can do is trigger the macros on post reload of the document.
You can trigger this by
Settings -> Document Properties -> Triggers -> Document Event Triggers -> On PostReload
Hope this helps you.
Regards,
Jagan.
Thanks for the info.
Is it possible to export objects to csv and not xls?
Hi,
Try this macro
SUB ExportChartToCSV
SET objChart = ActiveDocument.GetSheetObject("CH01")
objChart.Export "C:\Data.CSV", ", "
END SUB
This saves the csv file in C drive. Replace CH01 with your chart ID.
Regards,
Jagan.
and do you think there is a way to create a loop to export all charts in the UI automatically?
a sub that will set the file name as the chart ID.
Try this macro
SUB ExportChartToCSV
Dim myCharts(2)
myCharts(0) = "Coat"
myCharts(1) = "Suit"
myCharts(2) = "Boxes"
For Each item In myCharts
SET objChart = ActiveDocument.GetSheetObject(item)
objChart.Export "C:\" & item & ".CSV", ", "
Next
END SUB
Regards,
Jagan.
That means I need first to put all of my chart names into this array?
You can export a table to csv in the load script without a macro simply by using a store command with the (txt) qualifier.
store tablename into filename.csv (txt) ;