Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Excel Macro to pull data from Qlikview based on a parameters defined excel sheet.

Hi All,

I have a qvw file which is there on a server / portal available to wider audience. Basically it's a report with all data and charts. I usually have to go to that URL / Portal and load / open qvw file and then extract the data by selecting parameters for e.g. from one date to other date and for a particular region and then export it to excel which usually takes lot of time. I want to come up with a excel macro which will open the qvw file on the portal automatically and then based on the parameters .i.e. from date to date and region etc.. it will pull the data into a new or existing workbook. Since I am not very much familiar with qlikview as I have recently started using it I don't know much about the same. but any how I have done some google search and have got the below code so far with me.

Sub test2 ()
Dim doc1 As New QlikView.ActiveDocument
' ** doc1 is set to active document in open QV **
Set Appl = doc1.GetApplication
' ** Appl points at QV program **
' ** Appl.ActiveDocument points at doc1 **
Set doc2 = Appl.OpenDoc("C:\MyDoc.qvw", "", "")
doc2.Activate
' ** Appl.ActiveDocument now points at doc2 **
' ** Note difference from VBScript! **

End Sub

Any helps appreciated.

Thanks a lot for your help in advance.[:)]

10 Replies
Not applicable
Author

one quick advice - check this part of my script in terms of SMTP server setup:


With objFlds
'---------------------------------------------------------------------
' SMTP server details
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = SMTPServer
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = userName
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = userPassword
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = SMTPPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = SMTPTimeout
.Update
'---------------------------------------------------------------------
End With