Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro Nad Bookmark

Hi Guys

I have a book mark in my qvw, now i want to export to excel the straight table in that bookmark using macro

1 Solution

Accepted Solutions
Gysbert_Wassenaar

It's possible to create a macro that activates a bookmark and then exports a table to excel. Here's an example with a macro to export an object to excel.

To activate a bookmark add these two lines:

ActiveDocument.RecallDocBookmark "TestBookmark"

ActiveDocument.GetApplication.WaitForIdle


talk is cheap, supply exceeds demand

View solution in original post

8 Replies
Gysbert_Wassenaar

It's possible to create a macro that activates a bookmark and then exports a table to excel. Here's an example with a macro to export an object to excel.

To activate a bookmark add these two lines:

ActiveDocument.RecallDocBookmark "TestBookmark"

ActiveDocument.GetApplication.WaitForIdle


talk is cheap, supply exceeds demand
Not applicable
Author

Thanks Gysbert... it is really helpful .. i just want to ask you one more thing...

Can i call a Macro sub or function in my script........  ??????????????

i tried to call a macro function in the script and get the value that function in variable but it is coming NULL

Can you please help me regarding this

Gysbert_Wassenaar

Yes you can, but it has to be a function, not a sub. This will call a macro called MyFunction and return the result to vMyVar

Let vMyvar = MyFunction();


talk is cheap, supply exceeds demand
Not applicable
Author

can you please send me the demo applcation because i am also dong the same thing but  i am getting null in the variable

Gysbert_Wassenaar

Example attached. And here is another example.


talk is cheap, supply exceeds demand
Not applicable
Author

Can i also deactivate the Bookmark using macro

Gysbert_Wassenaar

ActiveDocument.ClearAll will clear all selections. That 'deactivates' the bookmark.

ActiveDocument.RemoveBookmarkById "BM01" will remove bookmark BM01 entirely.


talk is cheap, supply exceeds demand
farolito20
Contributor III
Contributor III

Any example of macro?