Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I want to write a macro to write a string out to a csv file.
Ive been looking on the internet and can't find an example of the code needed that works in qlikview.
I can get the string formated correctly in the macro, and I can get it to pop up in a message box, but I can't figure out how to simply write this string out to an externally located csv file. I want to simply append the string onto the end of the csv file (i.e on the next line) each time I run the macro.
Thanks
Dan
call following code on button click
sub sendtocsv
set
obj1 = ActiveDocument.GetSheetObject("CH1926")
obj1.Export "D:\Qlik2Finance\Work\SUNIL\Debtor_Booksize_daily_export\BOOKSIZE.csv"
,","
end
sub
inplace of CH1926 of give ur chartID
inplace of "D:\Qlik2Finance\Work\SUNIL\Debtor_Booksize_daily_export\BOOKSIZE.csv" give ur path
Thanks Sunil, but its variables I want to write out rather than a sheet object.
Ive found a solution now:
Const ForAppending = 8 'Setting to append to end of csv file
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(f_name,ForAppending,TristateFalse)
f.WriteLine VB_WRITESTRING
f.Close
Seems to work on desktop client, hoping it will work on accesspoint as well.
Thanks Sunil, but its variables I want to write out rather than a sheet object.
Ive found a solution now:
Const ForAppending = 8 'Setting to append to end of csv file
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile(f_name,ForAppending,TristateFalse)
f.WriteLine VB_WRITESTRING
f.Close
Seems to work on desktop client, hoping it will work on accesspoint as well.