Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing an active cell format in VBA Packman Excel Discussion (Misc queries) 4 April 6th 06 07:02 PM
Active X Error message RENEE Excel Discussion (Misc queries) 0 March 13th 06 07:30 PM
printing only active range (changing) oz_saar Excel Discussion (Misc queries) 2 August 2nd 05 08:42 PM
Changing active selection cursor Mistaken Creation Excel Discussion (Misc queries) 3 May 27th 05 10:06 PM
Changing Excel Icon in the Active Window Aaron[_6_] Excel Programming 3 August 7th 03 09:30 AM


All times are GMT +1. The time now is 09:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"