Qlik Community

New to QlikView

Discussion board where members can get started with QlikView.

Announcements
Customers, Partners & Luminaries only: You're invited to a Data Analytics Roadmap session. Read More
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

VBScript Automation API

While trying out the API guide of Qlikview 11 at QlikView Core COM API Guide - Version 11. It seems the number of methods do not run. example:

Set cs = objActiveDoc.GetSheetObject("TX92")

msgbox(cs.GetNoOfRows)

as per Send Mail from QlikView with table in the mail body

also, several  things are not working properly.

Can anybody give a good reference for solving all the VBScript - QlikView Automation.

Thanks

Saqib

2 Replies
Highlighted

I came to the same conclusion after testing many of the examples.

Some of them does not work...

But to know why you need to know more about VBS and probably the version of your qlik.

You can try to validate them yourself, Google it by looking for VBS course or contact the author.

Example you have provide  will not work

Set cs = objActiveDoc.GetSheetObject("TX92")

msgbox(cs.GetNoOfRows)

TX92 is a textbox which does not have any rows.

do you have any particular problem with macro?

Highlighted
Not applicable

I am facing issue to schedule the task as this is running all the time. Please help me with the exact documentation for VBScript-QlikView automation.

Dim objFSO :  Set objFSO = CreateObject("Scripting.FileSystemObject")

Set objTextFile = objFSO.OpenTextFile("sLOG.log",8,True)

Dim strDocPath : strDocPath= "D:\Qlikview\Scheduler\test1.qvw"

Dim strStoragePath : strStoragePath = "C:\New folder\"

Dim objQV_Application,objActiveDoc,ObjID

Dim strSheetName : strSheetName = "Ra Tracker"

Dim strObjID : strObjID = "TX92"

Dim PicName  : PicName = "header.jpg"

objTextFile.WriteLine "::STARTED::"

call Qlik2Shot(strDocPath,strSheetName,strObjID,strStoragePath,PicName)

objTextFile.WriteLine "::COMPLETED::"

Sub Qlik2Shot(TEMP_DocPath,TEMP_SheetName,TEMP_OBJ,TEMP_ShotPath,TEMP_ShotName)

Dim objQV_Application,objActiveDoc,ObjID

Rem Creating QllikView Application Instance

Set objQV_Application = CreateObject("QlikTech.QlikView")

If Err.Number<>0 Then

objTextFile.WriteLine Now() & " " & Err.Description & " " &  Err.Number

  End If

Rem Creating Document Instance

Set objActiveDoc = objQV_Application.OpenDoc(TEMP_DocPath)

If Err.Number<>0 Then

objTextFile.WriteLine Now() & " " & Err.Description & " " &  Err.Number

  End If

Rem Getting the Sheet

objActiveDoc.Sheets(TEMP_SheetName).Activate

If Err.Number<>0 Then

objTextFile.WriteLine Now() & " " & Err.Description & " " &  Err.Number

  End If

Rem Setting Object To Be Captured

set ObjID = objActiveDoc.GetSheetObject(TEMP_OBJ)

If Err.Number<>0 Then

objTextFile.WriteLine Now() & " " & Err.Description & " " &  Err.Number

  End If

Rem Exporting Bitmap

ObjID.ExportBitmapToFile TEMP_ShotPath & TEMP_ShotName

If Err.Number<>0 Then

objTextFile.WriteLine Now() & " " & Err.Description & " " &  Err.Number

  End If

Rem Closing Objects

Set ObjID = Nothing

objActiveDoc.Save

If Err.Number<>0 Then

objTextFile.WriteLine Now() & " " & Err.Description & " " &  Err.Number

  End If

WScript.Sleep(250)

Set objActiveDoc = Nothing

objQV_Application.Quit

If Err.Number<>0 Then

objTextFile.WriteLine Now() & " " & Err.Description & " " &  Err.Number

  End If

End Sub

objActiveDoc.Save

WScript.Sleep(1000)

Set objActiveDoc = Nothing

objQV_Application.Quit

End Sub