On workbook open:-
1) Set the zoom to 80% for Sheets("Sheet1")
2) Disable the Zoom button in the View menu.
3) Store the existing Intellimouse RollZoom status.
3) Set the Intellimouse Rollzoom status to false. This
is the equivalent to unselecting the "Zoom on roll with
Intellimouse" option available through Tools|Options.
On workbook deactivate:-
1) Reset the Zoom button.
2) Restore the Intellimouse Rollzoom status.
Note that the user can still hold down the Ctrl button and
use the Itellimouse wheel to adjust the zoom. I don't
think this case be prevented at least by means of VBA. It
will also be overridden if the user opens more than one
workbook.
Dim ZoomBtn As CommandBarControl
Dim RollZoomStatus As Boolean
Private Sub Workbook_Open()
Dim CB As CommandBar
ActiveWindow.Zoom = 80
With Application
RollZoomStatus = .RollZoom
..RollZoom = False
Set CB = .CommandBars("Worksheet Menu Bar")
Set ZoomBtn = CB.Controls("View").Controls("Zoom...")
ZoomBtn.Enabled = False
End With
End Sub
Private Sub Workbook_Deactivate()
ZoomBtn.Enabled = True
Application.RollZoom = RollZoomStatus
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.