Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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,
You can export to .txt file and then you can open in Excel.
store MyData into Samplefile.txt (txt);
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,
Thanks santiago.respaneIt worked perfectly.
Im Getting an error file not found and cant open file.Pls assist?
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?