Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

How perform "Close This Document" & "Open QlikView Document" Simultaneously

Hi All,

I want to perform "Close This Document" and "Open QlikView Document" at the same time with single click on the button. Condition is "Close This Document" should be executed first and then the "Open QlikView Document" which has be to executed next.

I am able to perform "Close This Document"on click of a button but not been able to perform "Open QlikView Document" on click of the same button.

Hope some one can help me out!

Same thing i have here also

http://community.qlik.com/forums/t/23732.aspx

http://community.qlik.com/forums/t/23802.aspx

8 Replies
Not applicable
Author

The following macro might do the trick:



sub closeAndOpen
set App = ActiveDocument.GetApplication
ActiveDocument.CloseDoc
App.OpenDoc "myApp.qvw"
end sub

Hope it helps

/Fredrik

Not applicable
Author

Hi Fredrik!

Thanks for your reply! Using you idea i can only close the application. I am not able to reopen as soon as it it closes the document. Let me know whether it worked or not.

After using it one of my document i am not able to open that document anymore :-). Infact i didn't the back up of that. Let me know is there is any way to revert back the changes. As my last copy is not available with me. Dont know the reason why there is no way to revert back the changes if something is wrong.

Also i dont have any idea why the automatic save(version) did not work.

Please help me out!

Not applicable
Author

Hi All!

Will be thankful if some one can give solution for this problem.

Not applicable
Author

I tried running the macro and it appears that it doesn't work if you run the macro inside of QV.
It works if you open another document but that wasn't what you we're looking for.
If you save this macro as xxx.vbs and run it when you click the button it works better:

set Qv = CreateObject("QlikTech.QlikView")
set ActiveDoc = Qv.ActiveDocument
ActiveDoc.CloseDoc
Qv.OpenDoc "myApp.qvw"

Why you can't open you document anymore, I can't really say. I haven't experienced any problems like that, sorry.

regards
/Fredrik

Not applicable
Author

Hi Fredrik!

As said i have created the *.vbs file. But let me know how i need to run that. When tried to run from Button --> Properties --> Action --> Launch-->Application(Browse) Selected the *.vbs file here. When i clicked it i got this error message. Let me know where i am going wrong.

Not applicable
Author

You have an issue in your vbs at the line 4.

It seems that you opened a string using " and didn't close it (unterminated string constant).

you can debug your vbs line by line by running Cscript.exe /X Myvbsfile.vbs

Rgds,

Sébastien

Not applicable
Author

Hi Sébastien!

Hi I don't know what changes you are telling. Can you do the required changes and send it to me please.By the way i couldn't understand what is this Cscript.exe /X Myvbsfile.vbs. Do i need execute this in the run?

Not applicable
Author

Hi All,

Can anyone help me out to solve this issue please!