Microsoft KB Archive/318050

= PRB: &quot;Object Required: 'ChartSpace1.Border'&quot; Run-Time Error When You Set the ChartSpace Border Properties for Office XP Chart Component =

Article ID: 318050

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft Internet Explorer (Programming) 6.0
 * Microsoft Office Chart Component 9.0
 * Microsoft Office Web Components
 * Microsoft Office Web Components

-



This article was previously published under Q318050



SYMPTOMS
When you run script that accesses the Border property for a Microsoft Office Chart component in Microsoft Internet Explorer 6.0, you receive the following run-time error:

Object Required: 'ChartSpace1.Border'



CAUSE
Internet Explorer 6.0 has added support for a Border property on the HTMLObjectElement. This change may create a conflict.

When you access an  on a Web page by its ID in script, you are referring to the wrapper that is around the object in Internet Explorer. When you reference the  .Border property, Internet Explorer first determines if the wrapper supports the property. If the wrapper does not support the property, Internet Explorer then passes the property call to the object itself.

Internet Explorer 6.0 now supports a Border property for the wrapper of a chart. Therefore, a call to Chartspace1.Border calls the Border property of the wrapper. It does not call the Border property for the ChartSpace, as you might expect.



RESOLUTION
To access the Border property for the chart and not for the wrapper, use the Object property for the ChartSpace, as follows: Chartspace1.Object.Border.Color = ChartSpace1.Constants.chColorNone



Steps to Reproduce the Behavior
  Save the following file as Border.htm.

&quot; id=&quot;ChartSpace1&quot;> Give Error Change Border



Function Btn1_OnClick Chartspace1.Border.Color = ChartSpace1.Constants.chColorNone End Function

Function Btn2_OnClick Chartspace1.Object.Border.Color = ChartSpace1.Constants.chColorNone End Function

Note Replace the  in the above code with the Class ID of the chart control being used.

For Microsoft Office Chart 10.0

002E556-0000-0000-C000-000000000046

For Microsoft Office Chart 11.0

0002E556-0000-0000-C000-000000000046  Start Internet Explorer, and then locate Border.htm.</li> Click Give Error. You receive a run-time error, and the ChartSpace border remains unchanged.</li> Press F5 to refresh the page.</li> Click Change Border. The color of the ChartSpace border changes as expected.</li></ol>

<div class="references_section">