Skip to main content
Announcements
Qlik Connect 2025: 3 days of full immersion in data, analytics, and AI. May 13-15 | Orlando, FL: Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Accessing QlikView documents from outside QlikView

Hi,

I have QV 9.0 PE.

But i want to Accessing QlikView documents from outside QlikView. So that i write the following vba code it throws an error. I added the references qv 9.0 type library in vb

Private Sub CommandButton1_Click()
Dim doc1 As New QlikView.ActiveDocument
Set app1 = doc1.GetApplication

Set doc2 = appl.OpenDoc("D:\Business.qvw", "", "")
doc2.Activate

End Sub

error as

automation error unspecified error vba

Thanks in advance

Murugavel

15 Replies
Not applicable
Author

Hi ,

Did you get any solution for this.

As i have the same requirement here. I want to call the other qv files (those are separate qvw files which are outside of the current QVW) from my qlickview document.

Please help me here.

Thanks,

Mahasweta

biester
Specialist
Specialist

I just tested (but only with VBScript), and this works fine:


Set App = CreateObject("QlikTech.QlikView")
Set Doc = App.OpenDoc("C:\test.qvw","","")
Doc.Activate


Rgds,
Joachim

Not applicable
Author

Hi Joachim,

Will you please help me?

I have the macro to call the files from outside of the current file.

And my macro is like

Sub Absorption

dim SelectedReportPath

set mySelections = ActiveDocument.fields("DESCRIPTION").GetPossibleValues

'Only if one selection is done

if mySelections.Count = 1 then

set FileName = ActiveDocument.fields("PATH").GetPossibleValues

Set App = ActiveDocument.GetApplication

'Set newdoc = App.opendoc ("D:\Modelos BI\Financiero.qvw")

Set newdoc = App.Opendoc (SelectedReportPath,"","")

End if

End Sub

This is working proper,but when i am putting in server its throwing the error saying "Macro parsing failed,functionality lost"



Could you please tell me where am missing?

Thanks,

Mahasweta







Not applicable
Author

Not too sure what you have done wrong in your macro, however, I do it differently and it works for me!

Create the following macro:

SUB Launch_QVW_Application
SET doc = ActiveDocument
SET b = doc.GetSheetObject("BU03")
SET bp = b.GetProperties
bp.Application.v = "C:\Program Files\Internet Explorer\IEXPLORE.EXE"
bp.Parameters.v = "qvp://ukqkv02/darqmatter/innovation/Investment Performance (Innovation).QVW"
b.SetProperties bp
b.Press
END SUB

You will notice that this "presses" a button, this button is included on the sheet but is hidden simply by creating a conditional show expression on the layout tab as 1<>1, the button on the general tab is marked as a Launch/Export type button.

You should then have another button that is marked to launch the other app, this button calls the macro above.

As I say, it works for me, so give it a go.

Not applicable
Author

Hi Nigel,

Thanks a ton for your reply.

Here do you navigate from one sheet of the QV document to the other sheet on click or what.

My requirement is like i have a list of items, and now when ever user clicks on any item thats needs to be open and moreover this items and the path for the QV needs to come from database dynamically.

Is this possible ?

Could you please relook the code and let me know as am new to macro ?

Please help me out.

IF possible can i have your email id please if you dont mind for the same?

Thanks & regards,

Mahasweta

Not applicable
Author

Hi Nigel,

I have implemented the solution provided by you.

But still i have some issues in that.

1- its asking to lunch the IE.exe which does not look good if the end user sees that pop up.

2- Its opening in a different window,in stead i want to open the specific document in the same window where my main report is there and then i should be able to navigate back to the main page.

Will you please look into these issues and give me some solutions please?

Thanks,

Mahasweta

Not applicable
Author

Hi Mahasweta

I think on number 1 you need to set the Requested Module Security and Current Local Security to Allow System Access in the macro code area, this should solve the question for you.

On number 2, if you find a solution to this then let me know, I tried for some time and gave up with it, there are no properties in QVW to allow this.

Regards,

mongolu
Creator
Creator

Murugavel S:

In API Guide version 9, on OpenDoc method says:
"
rem ** VBScript **
set App = ActiveDocument.GetApplication
set newdoc = App.OpenDoc ("C:\MyDocuments\QV4Automation.qvw","","")

set App = ActiveDocument.GetApplication
App.OpenDoc "C:\MyDocuments\Budget.qvw","JNN","123456"

rem ** Visual Basic **
dim App as New QlikView.Application
set newdoc = App.OpenDoc ("C:\MyDocuments\Budget.qvw","JN","123456")
"

Maybe this helps you.

I understand you want to open qv doc from outside Qv. And you do this from VBA.
So, i've made a test sub in Excel and it works:

Sub test()
Dim App As New QlikView.Application
Set newdoc = App.OpenDoc("D:\test.qvw", "", "")
End Sub

Mahasweta :

To open another Qv doc in the same qv window(process) you could use Document chaining (ver9), from Triggers.

To put this functionality on server, i don't know how it can be done.

But i spotted something interrupted in your code.
In this line
Set newdoc = App.Opendoc (SelectedReportPath,"","")
you say you want to open the qv doc which is it contained in the SelectedReportPath variable. But i don't see the line where you put a value in that var.

And yet, the error ""Macro parsing failed,functionality lost" says the syntax is wrong.

Not applicable
Author

Hi Murugavel,

Will you please help me out by correcting my macro ,as in my old macro in QlickView developer it was working proper as i want ,i mean it was opening in the same window.But thats failing in server.

So could you please correct my previous code as i posted above?

Thanks in adavance,

Mahasweta