![]() |
Error changing cells in VBA if a chart is active
I have some VBA code that selects a worksheet, then changes the value of some cells on that worksheet. That worksheet has some charts that reference those cells. If a user inadvertently has one of the charts selected when the macro is run, I get an error (Runtime Error "1004"). If the chart was not initially selected, the code runs fine. What is a good way to prevent this error? Is there a simple way to first deselect any charts? Using Excel 2000. Thanks, -- Rev |
Error changing cells in VBA if a chart is active
I have an answer, at least a workaround.
By adding the line: Range("A1").Select Before manipulating any cells, I do not get the error. -- Rev "Revolvr" wrote in message news:Gr35b.11073$QT5.6852@fed1read02... I have some VBA code that selects a worksheet, then changes the value of some cells on that worksheet. That worksheet has some charts that reference those cells. If a user inadvertently has one of the charts selected when the macro is run, I get an error (Runtime Error "1004"). If the chart was not initially selected, the code runs fine. What is a good way to prevent this error? Is there a simple way to first deselect any charts? Using Excel 2000. Thanks, -- Rev |
All times are GMT +1. The time now is 05:40 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com