xl2007, problem with Activechart.Deselect

B

bmurphy

The online help for excel 2007 says that Activechart.Deselect is
supposed to "be equivalent to pressing ESC while working on the active
chart".

When I use this command it doesn't appear to do anything.

In the VBE, when entering the above statement, after pressing the "."
and the drop down list of properties and methods appears, the Deselect
method is not in the list. Although the statement can be executed
without generating any error message.

Is there someway to get this command to work?

I've have not used it in earlier versions of excel, but it is in
xl2002, and it seems to work fine there. The online help topic looks
to be essentially equivalent to the one in xl2007.

I should point out that my xl2007 test system also has xl2003
installed on it.
 
J

Jon Peltier

I've noticed this. I think I got around it by using

Worksheets("Sheet1").Activate
Worksheets("Sheet1").Range("A1").Select

- Jon
 
B

bmurphy

Do you use both of those statements in succession?

I have been using ActiveChart.Parent.Select

This doesn't get all the way out of edit mode on an embedded chart,
but it does allow some of my macros to continue running.

Have you also tried

ActiveCell.Select

A problem with selecting a cell is it may cause the display to scroll
when you don't want it to.

I've also tried

ActiveChart.Parent.TopLeftCell.Select

This of course will get you all the way out of edit mode (embedded
charts only). If the chart is in the display, then no scrolling will
happen.

Brian
 
J

Jon Peltier

Brian -

I'm working from memory, and don't remember if 2007 could escape active
chart mode with just selecting a cell. It does a lot of things in subtly
different ways than 2003.

I suspect you will be better served to have separate 2003 and 2007 versions
of your add-in. The hassle of maintaining two versions of your add-in may
overcome the hassle of making one add-in version which is compliant in both
Excel versions.

- Jon
 
P

Peter T

Did you try what I suggested in my reply to your post under subject -
"excel 2007 problem, activewindow.visible = false does not work"

Regards,
Peter T
 
B

bmurphy

Dear Peter,

I did reply in that other thread, but I see now that my reply is not
there. I wonder why.

I recall that your suggestion looked like it was essentially to select
a cell on the worksheet. I am specifically trying to get around
selecting a worksheet cell to get out of edit mode on an embedded
chart.

Activewindow.visible = false does this in all earlier excel versions,
but not in xl2007.

Brian
 
P

Peter T

I recall that your suggestion looked like it was essentially to select
a cell on the worksheet.

That was the second step after activating .Windows(2), and subject to the
typical assumptions I mentioned (which can be catered for as necessary). I
don't use Activewindow.visible = false, at least not for deselecting charts.

FWIW, I only use cht.DeSelect as a step if the .ShowWindow property is true

I will be interested to know what works though, fairly soon I will have to
follow your path into 2007!

Regards,
Peter T
 

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