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

Is there anyway to resize graphs back to default with a button?

Is there anyway to resize graphs back to default with a button?

I made a button that applys a bookmark, but this still doesn't resize the graphs back to as when I loaded the document.

I want to keep the option to resize graphs though.

6 Replies
tseebach
Luminary Alumni
Luminary Alumni

Try this in a macro:

ActiveDocument.GetSheetObject("CH01").Restore

rem ** restore all sheet objects on sheet Main **

set s=ActiveDocument.Sheets("Main")

for i=0 to s.NoOfSheetObjects-1

    s.SheetObjects(i).Restore

next

Brett_Bleess
Former Employee
Former Employee

If you did not mean via a button object, but just via chart properties, on the General tab of the chart properties there are a couple of reset buttons there as well.  Reset User Sizing and Reset User Docking, which may also work for what you want here.  This will only work via the Desktop client though, but it seems may be what you are trying to get done now that I reread your post.  Hopefully it is the easiest solution for you.  Server clients don't have the ability to get to those settings.

To help users find verified answers, please do not forget to use the "Accept as Solution" button on any post(s) that helped you resolve your problem or question.
I now work a compressed schedule, Tuesday, Wednesday and Thursday, so those will be the days I will reply to any follow-up posts.
Not applicable
Author

So how precisely do I use this code to make a macro?  I pasted it in a edit module window.

How do I name the macro?  I know how to call it with a button.

Is there anything else I'd have to do with the macro code other than change the name of CH01 to the appropriate charts?

Not applicable
Author

Also, restoreing objects is an action for buttons, but it doesn't restore the graph sizes.

jagannalla
Partner - Specialist III
Partner - Specialist III

You can also restore your object without macro also.

Actions -> Add -> Layout -> In actions txtbox choose Restore Object and give the ObjectID which you want to restore.

If you want to do it in macro .

Sub Restore

     ActiveDocument.GetSheetObject("CH01").Restore

End Sub

In button actions-> Add -> External -> choose Run Macro -> Give Restore in Macro Name txtBox.

You run this action after the bookmark apply action.

Hope it helps you.

Not applicable
Author

The only issue is that restore doesn't restore the original column width.  If you change that resotre doesn't restore that aspect.