Skip to main content
Announcements
Get Ready. A New Qlik Learning Experience is Coming February 17! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

apply bookmarks for few fields in a sheet

Hi,

How to apply bookmark for only few objects in a sheet.

Whether it is possible , if it is possible how i can implement in my file.

Regards

Venkat

1 Solution

Accepted Solutions
qliksus
Specialist II
Specialist II

Hi 

then try this macro

sub v

ActiveDocument.ClearDocBookmarks

activedocument.fields("e").clear
activedocument.fields("f").clear
activedocument.fields("g").clear

ActiveDocument.CreateDocBookmark false, "MyBookmark"

ActiveDocument.Back
ActiveDocument.Back
ActiveDocument.Back


end sub

What this will do is when u click the button it will clear the fields which u dont want to include in Bookmark and

then it will create the Bookmark and again go back to the original state

and ur code  ActiveDocument.GetSheetObject("LB02").GetSelectedValues is wrong because u have to

take the column taken in that list box so ur code should be activedocument.fields("b").getselectedvalues

where b is the column u have taken in the list box

View solution in original post

15 Replies
Not applicable
Author

The two ways I've done this is to use Set Analysis or to Detach the objects you don't want the Bookmark to apply to.

Set Analysis works better since a Detached object is no longer interactive. The problem with Set Analysis is when you have a lot of fields you want the object to ignore.

Not applicable
Author

Hi Jamie Weber,

Pls can u explain more clear , and can you provide the steps how to implement apply bookmarks for only few fields in a sheet.

Regards
Venkat

raghavsurya
Partner - Specialist
Partner - Specialist

Hi,

Bookmarking is capturing the snapshot based on certain selections, but after saving a bookmark u can't have the same selections being retained.  It keeps changing once u make other selections.

Other option to do is Lock the selections.... it can be applied at individual selection boxes.

Regards,

Raghav

Not applicable
Author

Hi raghavsurya,

Thanks for your reply, but  i am sorry that i did't got your point clearly.

My Task is:

In my file sheet having 5 fields, i need to create bookmark for only 3 fields. The Other 2 fields should not have bookmark.

How it can be done ?

Regards

Venkat

qliksus
Specialist II
Specialist II


HI,

write this macro and call this on OnAnySelect

sub v

set sel =  activedocument.fields("b").getselectedvalues

if sel.count >= "1" then

ActiveDocument.ClearDocBookmarks

end if

end sub

Here b is field u dont want to include in the bookmark  so that when that is selected it will allow u to create bookmark

But once u clear the selection the bookmark will be deleted and if u do the same with other fields the bookmark will not be deleted

If this is not wat u want reply back

Not applicable
Author

HI qliksus

Thanks for your reply,

When i attached the macro code in my QVW file , it is generating an error msg i.e; Object doesn't support this property or method: 'ActiveDocument.GetSheetObject(...).GetSelectedValues'

I modified code like this,but it is generating error. Pls Check this.

sub v

set sel =  ActiveDocument.GetSheetObject("LB02").GetSelectedValues

if sel.count >= "1" then

ActiveDocument.ClearDocBookmarks

end if

end sub

Pls can you explain more clearly, the last points what you written in the post.

Here b is field u dont want to include in the bookmark  so that when that is selected it will allow u to create bookmark

But once u clear the selection the bookmark will be deleted and if u do the same with other fields the bookmark will not be deleted

Regards

Venkat

Not applicable
Author

Hi Qliksus,

Actual task i am trying to achieve is :

1.) In my QVW file sheet having 10 objects(inputboxes, listboxes,etc). Along with this one more object that is "Save Changes Button".

2.) When user made a selections in all objects, and click on the "Save Changes Button" , then only 5 objects should replace with existed BookMark i.e; BookmarkID="BM01".

I hope so you understand what i am trying to do .

Regards

Venkat

qliksus
Specialist II
Specialist II

Hi 

then try this macro

sub v

ActiveDocument.ClearDocBookmarks

activedocument.fields("e").clear
activedocument.fields("f").clear
activedocument.fields("g").clear

ActiveDocument.CreateDocBookmark false, "MyBookmark"

ActiveDocument.Back
ActiveDocument.Back
ActiveDocument.Back


end sub

What this will do is when u click the button it will clear the fields which u dont want to include in Bookmark and

then it will create the Bookmark and again go back to the original state

and ur code  ActiveDocument.GetSheetObject("LB02").GetSelectedValues is wrong because u have to

take the column taken in that list box so ur code should be activedocument.fields("b").getselectedvalues

where b is the column u have taken in the list box

Not applicable
Author

Hi Qliksus,

Thanks your post helps me.

And one more doubt whether i can provide ActiveDocument.GetSheetObject("LB02") instead of ActiveDocument.Fields("ABC").GetSelectedValue.

Bcoz if i am having one Inputbox and one Listbox with same field(i.e;ABC), now i want inputbox in Bookmark and not want with Listbox, then it might create a problem ?

Regards

Venkat