Home » Category » Microsoft Excel

Microsoft Excel: Zoom problem

205| Fri, 23 May 2008 08:58:00 GMT| anonymous| Comments (2)
In the below code, I get a Run-time error:'1004', "Unable
to set the Zoom property of the window class." The intent
here is to insure the window is sized to 54% when
the "Metrics" worksheet is selected by the macro. What do
I need to do to fix this?

Sub GoToMetric1()
'GoToMetricA1 Macro
Sheets("Metrics").Select
ActiveWindow.Zoom = 54
Range("A1").Select
ActiveSheet.ChartObjects("Chart 13").Activate
With ActiveChart.Parent
.Height = 550
.Width = 650
.Top = 10
.Left = 125
End With
End Sub

Keywords & Tags: zoom, microsoft, excel

URL: http://www.developertags.com/microsoft-excel/495194/
 
«« Prev - Next »» 2 helpful answers below.
Is the code in a sheet module. If so, try moving it to a general module and
call it from your sheetmodule.
--
Regards,
Tom Ogilvy

"Phil" <anonymous...discussions.microsoft.com> wrote in message
news:0c5201c39eed$81806920$a101280a...phx.gbl...
> In the below code, I get a Run-time error:'1004', "Unable
> to set the Zoom property of the window class." The intent
> here is to insure the window is sized to 54% when
> the "Metrics" worksheet is selected by the macro. What do
> I need to do to fix this?
> Sub GoToMetric1()
> 'GoToMetricA1 Macro
> Sheets("Metrics").Select
> ActiveWindow.Zoom = 54
> Range("A1").Select
> ActiveSheet.ChartObjects("Chart 13").Activate
> With ActiveChart.Parent
> .Height = 550
> .Width = 650
> .Top = 10
> .Left = 125
> End With
> End Sub

tom | Fri, 23 May 2008 08:59:00 GMT |

Thanks, Tom
>--Original Message--
>Is the code in a sheet module. If so, try moving it to a
general module and
>call it from your sheetmodule.
>--
>Regards,
>Tom Ogilvy
>"Phil" <anonymous...discussions.microsoft.com> wrote in
message
>news:0c5201c39eed$81806920$a101280a...phx.gbl...
>> In the below code, I get a Run-time
error:'1004', "Unable
>> to set the Zoom property of the window class." The
intent
>> here is to insure the window is sized to 54% when
>> the "Metrics" worksheet is selected by the macro. What
do
>> I need to do to fix this?
>> Sub GoToMetric1()
>> 'GoToMetricA1 Macro
>> Sheets("Metrics").Select
>> ActiveWindow.Zoom = 54
>> Range("A1").Select
>> ActiveSheet.ChartObjects("Chart 13").Activate
>> With ActiveChart.Parent
>> .Height = 550
>> .Width = 650
>> .Top = 10
>> .Left = 125
>> End With
>> End Sub
>
>.
>

phil | Fri, 23 May 2008 09:00:00 GMT |

Microsoft Excel Hot Answers

Microsoft Excel New questions

Microsoft Excel Related Categories