Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Guys,
Was wondering if something has a way to open a 2nd Qlikview File from within a Qlikview file.
The only way I see that maybe working is VB Script but I can't seem to pass that line in the code where it is creating the CreateObject...
Sub Run(ByVal sFile)
Dim shell
Set shell = CreateObject("WScript.Shell") ----> Does not go over this line of code in my case...why?
shell.Run Chr(34) & sFile & Chr(34), 1, false
Set shell = Nothing
End Sub
Then to use it include the script and call it as follows:
' Execute the file MyFile.exe
Run "C:\Program Files\MyFile.exe"
Or, use it to execute a file in the app that is registered to handle files of that type:
' Open the file MyFile.doc in Word
Run "C:\My Documents\MyFile.doc"
Anyone call help provide some code for this...Thx Ludwig
Hi there, the issue is likely to happen because of execution permission. Make sure to change your macro section security option to "system access" and "allow system access".
Regards
Hi,
If you need to call just another QV Document you don't need this type of macro. You can include a action for that (Actions -> External -> Open QlikView Document)
If you really need this, your problem is probably the security level.
At the module editor, on the left you will find the security level. You need to change both of them to system level.
You will probably need to save the document, open it again to allow unsafe macros That's necesary, since this code can send anything command to the OS.
I also adapted your code to call a variable from the interface:
You can check my attachment.
Sub Run
'(ByVal sFile)
set v = ActiveDocument.Variables("sFile")
command = v.GetContent.String
Dim shell
Set shell = CreateObject("WScript.Shell") ' ----> Does not go over this line of code in my case...why?
shell.Run Chr(34) & command & Chr(34), 1, false
'shell.Run Chr(34) & sFile & Chr(34), 1, false
Set shell = Nothing
End Sub
Hope it helps,
Erich
Erich,
Thx for your reply.
Option 1 you mentioned Actions -> External -> Open QlikView Document does not work! Also with a link it does not work. I had a discussion running about this a couple of days ago ....try it yourself and you'll see.
As far as I can see the only option here is really using a scrip-t like above. I got the script to work but it takes about 25 seconds to load the file and my users won't like that. And...not all machines have the dll installed that's required to load the app which requires installation work...
If Option 1 worked that would be ideal but on Version 9 Release 3 it does not!!
Thx
Ludwig
Erich,
Thx for your reply.
Option 1 you mentioned Actions -> External -> Open QlikView Document does not work! Also with a link it does not work. I had a discussion running about this a couple of days ago ....try it yourself and you'll see.
As far as I can see the only option here is really using a scrip-t like above. I got the script to work but it takes about 25 seconds to load the file and my users won't like that. And...not all machines have the dll installed that's required to load the app which requires installation work...
If Option 1 worked that would be ideal but on Version 9 Release 3 it does not!!
Thx
Ludwig
Are you using the server? Can you open it on a browser? If you can, only the first user would have to wait longer or you could use a preload setting (the application would be available on memory, even to the first user according to some settings)
Regards,
Erich