What VBA Stmt Will Deselect a Chart?

S

SidBord

I have a macro that works on a chart that the user has
previously selected with his cursor. When the macro exits,
the chart is still selected, which the user views as a
nuisance. I tried using the statement ACTIVECHART.DESELECT
just before exiting my macro, but it always causes an error
1004 saying that the DESELECT failed. What's that all about??
I read somewhere that I could use the
ACTIVECHART.VISIBLE = False statement, but that's REALLY
bad news . . . the chart disappears! Suggestions anyone?
 
A

Andy Pope

If the chart is on a worksheet try selecting one of the cells.
Range("A1").select

Cheers
Andy
 
J

Jon Peltier

Suggestion: Turn on the macro recorder, perform the action, and see what
is recorded. Here's what I got:

ActiveWindow.Visible = False
Windows("Book3").Activate
Range("G3").Select

I tweaked it slightly:

ActiveWindow.Visible = False
ActiveCell.Select

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top