Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

macro stopping edit module window pops up

Hi

I am setting zoom of all the tabs on press of button. Essentially I am calling following line on press of a button in a loop to set zoom for each of the tabs:

ActiveDocument.Sheets(x).FitZoomToWindow .

Now while I press the button, the 'Edit Module' window pops up and I have to press Check and OK for each of the tabs to make the zoom happen correctly.

Can someone please tell me how to stop this popping up of edit module window.

Rgds

Tarun

2 Replies
Not applicable
Author

if the edit module window comes up on macro trigger, it means there is something wrong with your macro, kindly check it in the debug mode

regards

peter

prieper
Master II
Master II

I think that FitZoomToWindow works only with the ActiveSheet-object, so you need to step through all sheets

ActiveDocument.ActiveSheet.FitZoomToWindow


Peter