Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
ChartCalculate code causing error when saving workbook
All,
I would appreciate any advice you could shed on this. I have a workbook which contains a number of pivot tables based on data in a second, external workbook. I have the undernoted code in the ChartCalculate event of a pivotchart in this book to get round the series formats going back to default when you pivot on the chart. When I try to save the workbook I get "Run time error 91 - Object or With block variable not set" message and the debugger takes me to the For.. line of this code. It's not a major problem as the purpose of the worksheet is for users to be able to interrogate a larger data set without being able to alter it in any way, so they should have no real need to save it. However, it's still annoying for me! The code is as follows: Private Sub Chart_Calculate() Dim X As Integer Application.ScreenUpdating = False For X = 1 To ActiveChart.SeriesCollection.Count With ActiveChart.SeriesCollection(X) .MarkerSize = 7 .Border.Weight = xlMedium End With Next X Application.ScreenUpdating = True End Sub Your suggestions are eagerly anticipated. Pete. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
What's causing error message? | Excel Worksheet Functions | |||
VLOOKUP Formula causing an error | Excel Discussion (Misc queries) | |||
error message when saving excel workbook | Excel Discussion (Misc queries) | |||
SAVING A COPY OF WORKBOOK W/O THE CODE IN IT | Excel Programming | |||
Saving a Workbook without code | Excel Programming |