There may not be an active window when you code runs, it this is happening
when Excel starts. Maybe a little delay will help:
Sub Auto_Open()
Application.OnTime DateAdd("s", 1, Now), "ZoomIt"
End Sub
Sub ZoomIt()
ActiveWindow.Zoom = 115
End Sub
--
Jim Rech
Excel MVP
"Randy Chow" wrote in message
...
IT Fired Up.ComGood day everyone. I was wondering if someone can give me a
pointer as to why the below routine errors out when put into a .xla Add-In.
I want this Add-In to autorun and change the Zoom value to 115%. I get the
following error "Object Variable or With Block Variable Not Set". Thanks
for everyones support.
Sub Auto_Open()
Worksheets("Sheet1").Activate
ActiveWindow.Zoom = 115
End Sub
Randy Chow - BSc. of Science, MCSE, MCDBA, CCNA, A+, NetCERT+
IT Fired Up.Com
Phone Number: (403) 605-5575
Email:
IT Fired Up.Com
Copyright © 2003
Email: