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: 
helen_pip
Creator III
Creator III

FitZoomToWindow Not working

Hello

I have researched on the internet and have found the following code:

  SUB FitZoomToWindow

ActiveDocument.ActiveSheet.FitZoomToWindow
ActiveDocument.ActiveSheet.ApplyZoomToAllSheets

END SUB

However this does not seem to be working in my button which I ahve assigned the macro too

I understand the above script to be VBScript, I am running this off our server which has Excel 2007 installed.  I know that Microsoft have stopped external uses for running vbscript in Excel 2007, could this be why the macro is not working for me?

Has anyone else experienced the syntex not running, and how they overcame this problem?

Thanks

Helen

2 Replies
Not applicable

Hi Helen

try this macro:

SUB Zoom

set CurrentSheet=ActiveDocument.ActiveSheet

set proper=CurrentSheet.GetProperties

proper.ZoomFactor = 1 ' try 1 to 4

CurrentSheet.SetProperties proper

END SUB

Not applicable

Hey,

I had the same problem and found the answer there:

http://www.qlikblog.at/444/qliktip-16-zoom-mit-makro-automatisieren/

The tricky point is to add the following line between the commands:

ActiveDocument.ActiveSheet.FitZoomToWindow 

ActiveDocument.GetApplication.WaitForIdle 

ActiveDocument.ActiveSheet.ApplyZoomToAllSheets

ActiveDocument.GetApplication.WaitForIdle 

I hope that helps!