Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
is there a way, with a macro, to create a "my server" bookmark?
I'm aware of the following codes:
ActiveDocument.CreateDocBookmark false,"test"
ActiveDocument.CreateUserBookmark false,"test"
but they do no create the bookmark on the server...Any insight?
thanks!
I think this won't be possible. But if you want create bookmarks for server-user you could create a document-bookmark and export this and import it again as server-bookmark.
- Marcus
Hi Marcus,
the idea is for users to press a button that will save their preferences as a bookmark (with a name pre-defined in the macro) so as the bookmark can be automatically loaded on open). Using a regular user bookmark doesnt work very well (laggy and buggy). But a server user bookmark works very well. The problem is that a macro can only create a simple user bookmark. Everything else works like a charm but it's a shame users have to manually create the bookmark so as it's saved as server user bookmark 😞
David
This could be done per actions and it should be also work on a server.
- Marcus
The actions require the bookmark ID, which is unique per user. Setting the bookmark with a macro goes with the name instead, so it can be consistent across users. Each bookmark is unique, based on each user's selection. However, the name being the same, it's easy to load it with a macro on open.
I was able to figure it out, using both a macro and action. The macro removes the bookmark (with the name) and the button, with action, creates a bookmark (using the same name). Works like a charm!
Hi David,
would you mind to share your sollution in more Detail with us? As I see it you were able to create a server bookmark with a pre defined name from a macro? Sounds cool, how exactly did you do it? Thanks for sharing!
Hi Martin,
here is how:
2 macros: one to remove any existing bookmark with the name "Default" and one to auto load that bookmark if it exists when the document opens.
sub remove_bookmark
On Error Resume Next
ActiveDocument.RemoveDocBookmark "Default"
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.RemoveUserBookmark "Default"
ActiveDocument.GetApplication.WaitforIdle
ActiveDocument.GetSheetObject("BU01").Press
end sub
The button called BU01 has an action: create bookmark, bookmark name: Default. Leave the bookmark ID blank
The button is hidden.
For some reason, Qlikview does not like it if you include this action as vb code as part of the previous code, hence the need to break it into 2 pieces (macro+button)
here is the code to use to load the bookmark (as a document trigger)
Sub UponOpen
on error goto 0
'Apply the Bookmark called "Default"
ActiveDocument.RecallDocBookmark "Default"
end sub