P
Phil Hageman
On a worksheet named Customer, is a command button (among
other command buttons) with a macro named "GoToMetric1"
assigned to it. The macro code is located in Module2 and
the code is:
Sub GoToMetric1()
Sheets("Metrics").Select
Range("A1").Select
ActiveSheet.ChartObjects("Chart 13").Activate
With ActiveChart.Parent
.Height = 660 '660 X 780 is landscape ratio 77%
(8 1/2" x 11")
.Width = 780
.Top = 10
.Left = 125
End With
End Sub
On a worksheet named Metrics, are various charts, with
Chart 13 displaying data.
The intent is when the user clicks on the command button,
Chart 13 (among other charts) on the Metrics worksheet
comes up; however, I'm getting a run-time error '1004':
Activate method of ChartObject class failed. Can someone
help me correct this error?
There is also an Auto Open routine being run when the
workbook opens, located in Module1, with the following
code:
Sub Autpen()
Application.ScreenUpdating = False
Application.DisplayFullScreen = True
For Each ws In Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select
Application.GoTo ws.Range("A1"), True
ActiveWindow.DisplayGridlines = False
End If
Next
Worksheets("Scorecard").Select
ThisWorkbook.Colors(7) = RGB(255, 124, 128)
Application.AutoPercentEntry = True
Application.ScreenUpdating = True
End Sub
other command buttons) with a macro named "GoToMetric1"
assigned to it. The macro code is located in Module2 and
the code is:
Sub GoToMetric1()
Sheets("Metrics").Select
Range("A1").Select
ActiveSheet.ChartObjects("Chart 13").Activate
With ActiveChart.Parent
.Height = 660 '660 X 780 is landscape ratio 77%
(8 1/2" x 11")
.Width = 780
.Top = 10
.Left = 125
End With
End Sub
On a worksheet named Metrics, are various charts, with
Chart 13 displaying data.
The intent is when the user clicks on the command button,
Chart 13 (among other charts) on the Metrics worksheet
comes up; however, I'm getting a run-time error '1004':
Activate method of ChartObject class failed. Can someone
help me correct this error?
There is also an Auto Open routine being run when the
workbook opens, located in Module1, with the following
code:
Sub Autpen()
Application.ScreenUpdating = False
Application.DisplayFullScreen = True
For Each ws In Worksheets
If ws.Visible = xlSheetVisible Then
ws.Select
Application.GoTo ws.Range("A1"), True
ActiveWindow.DisplayGridlines = False
End If
Next
Worksheets("Scorecard").Select
ThisWorkbook.Colors(7) = RGB(255, 124, 128)
Application.AutoPercentEntry = True
Application.ScreenUpdating = True
End Sub