View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.charting
sr152
 
Posts: n/a
Default How to deselect a selected chart programatically?

I'm using the excel automation objects (Microsoft.Office.Interop.Excel) for
Office 2003. Using C#.NET I'm retrieving the list of worksheets in a
workbook. For each worksheet, if there is a chart on the worksheet there is a
further processing that is required. However, I need to de-select a selected
chart area (when the mouse is clicked on the chart area the chart and the
data columns get selected). I have used:
foreach(Excel.Chart chart in workbook.Charts)
{
try
{
chart.Deselect();
PageSetup(excelApp, chart);
}
catch(Exception err)
{
PlugInTrace.WriteException(err);
}
}

The above piece of code does not undo the selection of the chart area. Any
help is greatly appreciated.

Thanks.