excel 2007 problem, activewindow.visible = false does not work

B

bmurphy

Hello All,

I'm just now starting to port a huge addin to excel 2007. What a
mess!

To get out of chart edit mode on an embedded chart, I have always used
the following:

ActiveWindow.Visible = False

But this doesn't seem to work in Excel 2007.

Is there a simple way to get out of chart edit mode and return to the
worksheet?

I suppose doing a Select of a worksheet cell might do it, but I'd
rather not have to do it that way.

Thanks,

Brian Murphy
 
P

Peter T

Hi Brian,

I don't have Excel 2007, in earlier versions simply Range("A1").select
normally works (but not always). I use at least one extra step, this is a
small snippet from a routine I use to de-select an embedded chart.

Assuming -
- Selection is an ActiveChart but not the ChartObject, eg ChartArea
- The ShowWindow property is false
- Apart from the chart window the Workbook only has one other window which
is visible
- The Chartobject is on a Worksheet, not on a chart-sheet

With ActiveWorkbook.Windows(2)
.Activate ' selects the chartobject
.VisibleRange(1, 1).Select
' or .RangeSelection(1, 1).Select if it intersects the VisibleRange
End With

This caters for 'the' typical scenario, but should check and cater for
others, ie the assumptions.

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