Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am trying to create the QlikView Document and add the binary statement using the vbs script. I am able to create the Document and open the Edit script using the below vb script
Set objFSO = CreateObject("Scripting.FileSystemObject")
set qv = CreateObject("QlikTech.QlikView")
Set docObj = qv.CreateDoc
docObj.DialogEditScript
But not finding the way to add the Binary Statement and the Load script. Any suggestions to include the Binary statement and Load script in the above macro
Try it with:
docprop.Script = "Binary C:\Users\sds\Desktop\ttt.qvw;" & docprop.Script
- Marcus
Have a look on this example from APIGuide.qvw:
rem ** add new line to script **
set docprop = ActiveDocument.GetProperties
docprop.Script = docprop.Script & "Load * from abc.csv;"
ActiveDocument.SetProperties docprop
- Marcus
Thanks Marcus for your response.
i tired it for the Binary Load is coming after the set statement. like this
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
Binary C:\Users\sds\Desktop\ttt.qvw;
where as i need to place Binary statement. If we are able to clear the set statements then the problem is resolved .
Try it with:
docprop.Script = "Binary C:\Users\sds\Desktop\ttt.qvw;" & docprop.Script
- Marcus
Thanks Marcus for trying to help me out and really appreciate your quick response.
Still the set statements are there
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
Binary C:\Users\sds\Desktop\ttt.qvw;///$tab Main
SET ThousandSep=',';
SET DecimalSep='.';
SET MoneyThousandSep=',';
SET MoneyDecimalSep='.';
SET MoneyFormat='$#,##0.00;($#,##0.00)';
SET TimeFormat='h:mm:ss TT';
SET DateFormat='M/D/YYYY';
SET TimestampFormat='M/D/YYYY h:mm:ss[.fff] TT';
SET MonthNames='Jan;Feb;Mar;Apr;May;Jun;Jul;Aug;Sep;Oct;Nov;Dec';
SET DayNames='Mon;Tue;Wed;Thu;Fri;Sat;Sun';
I used the script as
Set objFSO = CreateObject("Scripting.FileSystemObject")
set qv = CreateObject("QlikTech.QlikView")
Set docObj = qv.CreateDoc
docObj.DialogEditScript
set docprop = docObj.GetProperties
docprop.Script = docprop.Script & "Binary C:\Users\sds\Desktop\ttt.qvw;"& docprop.Script
docObj.SetProperties docprop
Hi Marcus,
Thanks for your support. I am not able to close the edit script with macro. I tried to search the API guide but couldn't able to get the details. It would be helpful if you could provide some inputs.
Try:
docObj.closedoc 'close application
qv.GetApplication.Quit 'close qlikview
- Marcus
Hi Marcus,
I tried it is not closing the editscript window.
Try this:
docObj.GetApplication.Quit
or
ActiveDocument.GetApplication.Quit
- Marcus
Thank you very much for your support
Set objFSO = CreateObject("Scripting.FileSystemObject")
set qv = CreateObject("QlikTech.QlikView")
Set docObj = qv.CreateDoc
docObj.DialogEditScript
docObj.CloseDoc
docObj.GetApplication.Quit
it is not working