T
tiamat
Hi,
I am running Excel 2007 XP sp 3 and I have found you will get a stack
overflow exception if you:
1. Create a chart where the range is specified by SetDataSource
2. Select the chart so the chart and the series data are both selected
3. Make a request to retrieve a custom property for the worksheet
via :
Office.DocumentProperties props = null;
try
{
props = (Office.DocumentProperties)wb.CustomDocumentProperties;
if (props == null)
return matches;
// Check that the property does not already exist
for (int custom = 1; custom <= props.Count; custom++)
{
Office.DocumentProperty property = props[custom];
property = null;
}
}
....
The only workaround I have found so far is before I request the custom
property I reset the cell selection I.e.
Excel.Range rgCell = ws.get_Range("A$1$", "A$1$");
rgCell.Select();
rgCell = null;
This is a horrible hack - ideally I would like to 'Deselect' the chart and
its series data. However, using the Deselect method of Chart does not help as
the data is deselected but the chart still shows the selection border.
Can anyone provide any insight or help. Note I get a similar issue if I try
to write cell comments when a chart is selected.
If anything it would be useful to programmatically find what a charts series
range is and what the current selection range is and see if they intersect.
If so I can do the manual hack as above, if not, which is more pleasing then
do not attempt to reset.
Open to any suggestions.
Ta
I am running Excel 2007 XP sp 3 and I have found you will get a stack
overflow exception if you:
1. Create a chart where the range is specified by SetDataSource
2. Select the chart so the chart and the series data are both selected
3. Make a request to retrieve a custom property for the worksheet
via :
Office.DocumentProperties props = null;
try
{
props = (Office.DocumentProperties)wb.CustomDocumentProperties;
if (props == null)
return matches;
// Check that the property does not already exist
for (int custom = 1; custom <= props.Count; custom++)
{
Office.DocumentProperty property = props[custom];
property = null;
}
}
....
The only workaround I have found so far is before I request the custom
property I reset the cell selection I.e.
Excel.Range rgCell = ws.get_Range("A$1$", "A$1$");
rgCell.Select();
rgCell = null;
This is a horrible hack - ideally I would like to 'Deselect' the chart and
its series data. However, using the Deselect method of Chart does not help as
the data is deselected but the chart still shows the selection border.
Can anyone provide any insight or help. Note I get a similar issue if I try
to write cell comments when a chart is selected.
If anything it would be useful to programmatically find what a charts series
range is and what the current selection range is and see if they intersect.
If so I can do the manual hack as above, if not, which is more pleasing then
do not attempt to reset.
Open to any suggestions.
Ta