Microsoft KB Archive/832116

= Document Actions task pane does not update when you programmatically add or delete an XML Map in Excel 2003 =

Article ID: 832116

Article Last Modified on 1/9/2004

-

APPLIES TO


 * Microsoft Office Excel 2003

-





SYMPTOMS
When you add or when you delete an XML Map in a Microsoft Office Excel 2003 workbook, the Document Actions task pane for your Smart Document solution is not updated to reflect your change.



RESOLUTION
To resolve this problem, call the Activate method for a Range object on the Excel 2003 workbook to update the Document Actions task pane. When you do this, the Document Actions task pane contents reflect your change.



STATUS
Microsoft has confirmed that this is a problem in Excel 2003.



Steps to reproduce the problem
The following steps use information and files that are installed with the Microsoft Office 2003 Smart Document software development kit (SDK). For additional information about how to download and how to use the Office 2003 Smart Document SDK, visit the following Microsoft Web site:

http://www.microsoft.com/downloads/details.aspx?FamilyID=24a557f7-eb06-4a2c-8f6c-2767b174126f

 To modify and to build the SimpleSample Microsoft Visual Basic 6.0 project, follow these steps:  Start Visual Basic 6.0. On the File menu, click Open Project.

The Open Project dialog box appears. Locate the SimpleSample Visual Basic 6.0 project that is included with the Office 2003 Smart Document SDK, and then click Open.

Note The default location for the project file is C:\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office 2003 Smart Document SDK\Samples\SimpleSampleVB6\SimpleSample.vbp.  Locate the following line of code in clsActions.cls: Const cBUTTON As String = cNAMESPACE & &quot;#commandbutton&quot; Replace that code with the following code: Const cBUTTON As String = cNAMESPACE & &quot;#actionPertainsToEntireSchema&quot; Note The Smart Document #actionPertainsToEntireSchema control is considered a default control and applies to all elements in the Smart Document.  On the File menu, click Make SimpleSample.dll, and then click OK in the Make Project dialog box.</li></ol> </li> To install the SimpleSample Smart Document solution, follow these steps: <ol style="list-style-type: lower-alpha;"> In Microsoft Windows Explorer, move to the C:\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office 2003 Smart Document SDK\Samples\SimpleSampleVB6\ folder. Double-click DisableManifestSecurityCheck.reg to disable the manifest security check so that you can test the solution.</li> Start a new workbook in Excel 2003.</li> On the Data menu, point to XML, and then click XML Expansion Packs.

The XML Expansion Packs dialog box appears.</li> Click Add. Locate C:\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office 2003 Smart Document SDK\Samples\SimpleSampleVB6\manifest.xml. Select C:\Program Files\Microsoft Office 2003 Developer Resources\Microsoft Office 2003 Smart Document SDK\Samples\SimpleSampleVB6\manifest.xml, and then click Open.

Note If you are prompted to re-enable XML expansion pack security, click No.</li> Click Simple Smart Document Sample - VB6 in the list of available XML expansion packs, click Attach, and then click OK.

The Document Actions task pane appears.</li></ol> </li> Press ALT+F11 to start the Visual Basic Editor.</li> On the Insert menu, click Module.

Module1 is added to the project for the workbook.</li>  Add the following code to the code window for Module1: Public Sub AddXMLMap ActiveWorkbook.XmlMaps.Add( _       &quot;C:\Program Files\Microsoft Office 2003 Developer Resources\&quot; & _        &quot;Microsoft Office 2003 Smart Document SDK\Samples\SimpleSampleVB6\&quot; & _        &quot;SimpleSample.xsd&quot;, &quot;example&quot;).Name = &quot;example_Map&quot; 'ActiveCell.Activate End Sub

Public Sub DeleteXMLMap ActiveWorkbook.XmlMaps(&quot;example_Map&quot;).Delete 'ActiveCell.Activate End Sub </li> Close the Visual Basic Editor to return to Excel 2003.</li> To test the AddXMLMap macro and the DeleteXMLMap macro, follow these steps: <ol style="list-style-type: lower-alpha;"> On the Tools menu, point to Macro, and then click Macros. Select AddXMLMap, and then click Run.

Notice that the Document Actions task pane does not update to display the button. Click any cell in the workbook. The task pane updates.</li> On the Tools menu, point to Macro, and then click Macros. Select DeleteXMLMap, and then click Run.

Notice that the Document Actions task pane does not update. Click any cell in the workbook. The task pane updates, and the button no longer appears.</li></ol> </li>  To work around the problem, uncomment the two calls to the following line of code in the AddXMLMap macro and in the DeleteXMLMap macro: ActiveCell.Activate </li> Repeat step 7.</li></ol>

Keywords: kbbug kbofficesmartdoc kbautomation kbnofix KB832116

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.