Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi all,
I need to close the qlikview document when some condition exists.
I tried to write a macro just like :
ActiveDocument.ActiveSheet.Close
and called it in the edit script but it didn' t worked.
Is there any way to do this ?
Regards
Hi,
I've attached a workaround.
Hope it may be helpful in your case.
Check in this document the script:
let v = '1';
if Match($(v), '1') then
EXIT Script
ENDIF
//rest of the code
let v = '2';
The macro sub:
sub Close()
vMacro = ActiveDocument.Variables("v").GetContent.String
if vMacro = 1 then
ActiveDocument.GetApplication.Quit
end if
end sub
And the trigger in Settings > Document Properties > Triggers.
OnPostReload > External > Run Macro > Close
Hope this helps you.
Hi,
Open and Close the active document
Set Appli=ActiveDocument.GetApplication
Set NewDoc= App.OpenDoc("C:\MyApplication.qvw","","")
ActiveDocument.Active
//Close the document
NewDoc.CloseDoc
I hope it helps U.
~Kabilan K
Hi,
Thanks for your reply,
but still not working,
My code is as following ,
-------------------------------------------------------------------
LOAD A,
B
FROM
C:\tst.xlsx
(ooxml, embedded labels);
//this must be closed
let mTst = fClose(a);
//but still works..
--------------------------------------------------------------------
my script is as :
-------------------------------------------------------------------
function fClose(a)
Set Appli=ActiveDocument.GetApplication
Set NewDoc= App.OpenDoc("C:\TTest.qvw","","")
ActiveDocument.Active
'Close the document
NewDoc.CloseDoc
end function
-------------------------------------------------------------------
Maybe I have some sysntax error,
Any Idea ?
Hi,
I've attached a workaround.
Hope it may be helpful in your case.
Check in this document the script:
let v = '1';
if Match($(v), '1') then
EXIT Script
ENDIF
//rest of the code
let v = '2';
The macro sub:
sub Close()
vMacro = ActiveDocument.Variables("v").GetContent.String
if vMacro = 1 then
ActiveDocument.GetApplication.Quit
end if
end sub
And the trigger in Settings > Document Properties > Triggers.
OnPostReload > External > Run Macro > Close
Hope this helps you.
Well, in the end it works!
Thanks jp_bakhache , that is what I need.
Hi, sorry for jumping in on this thread. Im jumping from one document to another using the Open Qlikview Document action.. Is there any way of closing the document I have jumped from after the second document has opened?
Thanks,
Tom