Qlik Community

Ask a Question

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Join this live chat April 6, 10AM EST - QlikView to Qlik Sense REGISTER
cancel
Showing results for 
Search instead for 
Did you mean: 
brindlogcool
Creator III
Creator 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
marcus_sommer
MVP & Luminary
MVP & Luminary

Try it with:

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

- Marcus

View solution in original post

14 Replies
marcus_sommer
MVP & Luminary
MVP & Luminary

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

brindlogcool
Creator III
Creator III
Author

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 .

marcus_sommer
MVP & Luminary
MVP & Luminary

Try it with:

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

- Marcus

View solution in original post

brindlogcool
Creator III
Creator III
Author

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

brindlogcool
Creator III
Creator III
Author

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.

marcus_sommer
MVP & Luminary
MVP & Luminary

Try:


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

- Marcus

brindlogcool
Creator III
Creator III
Author

Hi Marcus,

I tried it is not closing the editscript window.

marcus_sommer
MVP & Luminary
MVP & Luminary

Try this:

docObj.GetApplication.Quit


or


ActiveDocument.GetApplication.Quit


- Marcus

brindlogcool
Creator III
Creator III
Author

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