Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting zoom of a worksheet in macro
Simple question it seems, but I can't find an answer.
I'm running a simulation macro for pricing optimization. Th simulation results are written to a comma delimited file (I want t archive it anyway) and then read into a new worksheet, where I generat some summary statistics, make some charts, neatly align the charts etc. Everything up to this point works fine. Next I would like to set the zoom on the new worksheet to 50% so tha when the simulation is complete the user can see all the charts withou having to scroll around (albeit smaller versions of the charts, whic is OK). Right now when the simulation is complete the results worksheet i active - but it's at 100% zoom. I tried using ActiveWindow.Zoom = 50 in the macro and I get a "run tim error 1004, unable to set zoom property of the windows class." And a any rate I only want to set the zoom for the active sheet, not th whole workbook, which it seems is "the active window." Tried also Worksheets(Sheets.Count).PageSetup.zoom = 50 but it seems that only pertains to printing. I appreciate any help! Regards, J -- Message posted from http://www.ExcelForum.com |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting zoom of a worksheet in macro
ActiveWindow.Zoom = 50
works fine and only sets the zoom for the activesheet in the activewindow. It is unclear why you are having problems. It might have something to do with where the focus is when you execute the command. -- Regards, Tom Ogilvy "jhartley " wrote in message ... Simple question it seems, but I can't find an answer. I'm running a simulation macro for pricing optimization. The simulation results are written to a comma delimited file (I want to archive it anyway) and then read into a new worksheet, where I generate some summary statistics, make some charts, neatly align the charts, etc. Everything up to this point works fine. Next I would like to set the zoom on the new worksheet to 50% so that when the simulation is complete the user can see all the charts without having to scroll around (albeit smaller versions of the charts, which is OK). Right now when the simulation is complete the results worksheet is active - but it's at 100% zoom. I tried using ActiveWindow.Zoom = 50 in the macro and I get a "run time error 1004, unable to set zoom property of the windows class." And at any rate I only want to set the zoom for the active sheet, not the whole workbook, which it seems is "the active window." Tried also Worksheets(Sheets.Count).PageSetup.zoom = 50 but it seems that only pertains to printing. I appreciate any help! Regards, JH --- Message posted from http://www.ExcelForum.com/ |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting zoom of a worksheet in macro
Tom,
Thanks I'll double check the focus. At least now I know what should work. Cheers, Jef -- Message posted from http://www.ExcelForum.com |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Setting zoom of a worksheet in macro
Jeff
Also, make sure you have a cell (or range of cells) activated when you run the "Zoom" code - if a chart is selected the code "ActiveWindow.Zoom = 50" will fail. -- XL2002 Regards William "jhartley " wrote in message ... | Tom, | | Thanks I'll double check the focus. | | At least now I know what should work. | | Cheers, | | Jeff | | | --- | Message posted from http://www.ExcelForum.com/ | |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Setting Default Zoom | Excel Discussion (Misc queries) | |||
Value of Zoom print setting | Excel Programming | |||
Setting zoom for all worksheet pages | Excel Programming | |||
Setting zoom for all worksheet pages | Excel Programming | |||
Setting zoom for all worksheet pages | Excel Programming |