Skip to main content
Announcements
Introducing a new Enhanced File Management feature in Qlik Cloud! GET THE DETAILS!
cancel
Showing results for 
Search instead for 
Did you mean: 
mparker123
Creator
Creator

Fit Zoom To Window

Hello All,

I am having trouble setting up a button that when you click it, it will automatically Fit Zoom To Window. Many people in my company have different size monitors so it is something I would like to do.  Again I want people to be able to click on a button that will Fit to zoom for them. I don't want it to be on Reload or Open unless this is the only way it can be done. 

Attached is a photo of the Button, Button Properties window, and Edit Module window. These windows contain my macros and my expressions.

1 Solution

Accepted Solutions
Anil_Babu_Samineni

Try this?

Sub Zoom

ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.ActiveSheet.FItZoomToWindow

End Sub

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful

View solution in original post

4 Replies
Frank_Hartmann
Master II
Master II

Try like that:

Sub FitZoom()

ActiveDocument.ActiveSheet.FitZoomToWindow

End Sub

hope this helps

mparker123
Creator
Creator
Author

I did that now when i click on the button it loads the "Edit Module window; does not fit to zoom.

Anil_Babu_Samineni

Try this?

Sub Zoom

ActiveDocument.GetApplication.WaitForIdle

ActiveDocument.ActiveSheet.FItZoomToWindow

End Sub

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
el_aprendiz111
Specialist
Specialist

Hi,

Sub ZoomIn '-

set mysheet=ActiveDocument.ActiveSheet

set sp=mysheet.GetProperties

sp.ZoomFactor = sp.ZoomFactor-0.15

mysheet.SetProperties sp

End Sub

Sub ZoomOut '+

set mysheet=ActiveDocument.ActiveSheet

set sp=mysheet.GetProperties

sp.ZoomFactor = sp.ZoomFactor+0.15

mysheet.SetProperties sp

End Sub