Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting Default Zoom Rawle Excel Discussion (Misc queries) 1 August 15th 07 12:33 PM
Value of Zoom print setting Dave Peterson[_3_] Excel Programming 0 July 18th 03 04:38 AM
Setting zoom for all worksheet pages don lloyd Excel Programming 1 July 17th 03 01:40 AM
Setting zoom for all worksheet pages skmr3 Excel Programming 0 July 15th 03 02:53 AM
Setting zoom for all worksheet pages Paul B[_6_] Excel Programming 0 July 15th 03 02:45 AM


All times are GMT +1. The time now is 06:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"