View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default excel 2007 problem, activewindow.visible = false does not work

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


wrote in message
ups.com...
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