ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Weird scenario leading to ResetColors crash (https://www.excelbanter.com/excel-programming/324225-weird-scenario-leading-resetcolors-crash.html)

Peter T

Weird scenario leading to ResetColors crash
 
Hi All

If I reference Shapes on a chart sheet, then switch to a normal Worksheet
and Reset the default palette - Excel crashes, both XL97 and XL2000.

However no problem later to reset the palette if the same Chart sheet is
still active. Also, if I check the shapes on a chart object on a worksheet,
I can reset default palette while any type of sheet is active.

It's taken a very long time to track what appeared to be intermittent
crashes to these two innocuous lines, dispersed in a large project.

Not sure if anyone else will reproduce the same GPF, but is these some other
way I can reference shapes on a chart sheet and later be able to reset
palette on a normal worksheet.

Sub ChtShapes()
Dim n As Long, ob As Object
'run on a chart sheet

n = ActiveChart.Shapes.Count
'or
'Set ob = ActiveChart.Shapes

End Sub

Sub ColorsReset()
' **** posible crash - ensure no work loaded

'switch to a normal worksheet
ActiveWorkbook.ResetColors

End Sub

Thanks in advance,
Peter T




All times are GMT +1. The time now is 01:02 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com