C
Craig Brandt
I'll try to get this as concise as possible. I have a macro that creates a
chart and places it on the activesheet ("Param"). I save the name of that
chart and store it on the sheet ("Param"), so that I know the name and can
delete the chart later when I create another.
I recently added a feature to the workbook and have a macro on the "Param"
sheet that reacts to change. I use this "change" macro to monitor for a
change in a cell that assigns the number of days to display and this works
fine under normal operating conditions.
When I execute the macro that makes a new chart, the macro creates the chart
and saves the name of the chart with this line:
Sheets("Param").Cells(10, 8) = ActiveChart.Name
This triggers the "change" routine and I get the following error
Run time error '91':
Object variable or with variable not set.
on the indicated line of code shown below.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ActRowX As Integer
Dim ActColX As Integer
ActRowX = ActiveCell.Row '<<<<<< Error occurs here
ActColX = ActiveCell.Column
If ActRowX = 8 And ActColX = 8 Then
chart and places it on the activesheet ("Param"). I save the name of that
chart and store it on the sheet ("Param"), so that I know the name and can
delete the chart later when I create another.
I recently added a feature to the workbook and have a macro on the "Param"
sheet that reacts to change. I use this "change" macro to monitor for a
change in a cell that assigns the number of days to display and this works
fine under normal operating conditions.
When I execute the macro that makes a new chart, the macro creates the chart
and saves the name of the chart with this line:
Sheets("Param").Cells(10, 8) = ActiveChart.Name
This triggers the "change" routine and I get the following error
Run time error '91':
Object variable or with variable not set.
on the indicated line of code shown below.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ActRowX As Integer
Dim ActColX As Integer
ActRowX = ActiveCell.Row '<<<<<< Error occurs here
ActColX = ActiveCell.Column
If ActRowX = 8 And ActColX = 8 Then