Qlik Community

QlikView App Development

Discussion Board for collaboration related to QlikView App Development.

brindlogcool
Contributor III

Binary Statement through vbscript

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

1 Solution

Accepted Solutions
Highlighted
MVP & Luminary
MVP & Luminary

Re: Binary Statement through vbscript

Try it with:

docprop.Script = "Binary C:\Users\sds\Desktop\ttt.qvw;" & docprop.Script

- Marcus

View solution in original post

14 Replies
Highlighted
MVP & Luminary
MVP & Luminary

Re: Binary Statement through vbscript

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

Highlighted
brindlogcool
Contributor III

Re: Binary Statement through vbscript

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 .

Highlighted
MVP & Luminary
MVP & Luminary

Re: Binary Statement through vbscript

Try it with:

docprop.Script = "Binary C:\Users\sds\Desktop\ttt.qvw;" & docprop.Script

- Marcus

View solution in original post

Highlighted
brindlogcool
Contributor III

Re: Binary Statement through vbscript

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

Highlighted
brindlogcool
Contributor III

Re: Binary Statement through vbscript

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.

Highlighted
MVP & Luminary
MVP & Luminary

Re: Binary Statement through vbscript

Try:


docObj.closedoc 'close application
qv.GetApplication.Quit 'close qlikview

- Marcus

Highlighted
brindlogcool
Contributor III

Re: Binary Statement through vbscript

Hi Marcus,

I tried it is not closing the editscript window.

Highlighted
MVP & Luminary
MVP & Luminary

Re: Binary Statement through vbscript

Try this:

docObj.GetApplication.Quit


or


ActiveDocument.GetApplication.Quit


- Marcus

Highlighted
brindlogcool
Contributor III

Re: Binary Statement through vbscript

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