Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


Status

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

↑ Back to the top


More information

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:
  1. To modify and to build the SimpleSample Microsoft Visual Basic 6.0 project, follow these steps:
    1. Start Visual Basic 6.0.
    2. On the File menu, click Open Project.

      The Open Project dialog box appears.
    3. 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.
    4. Locate the following line of code in clsActions.cls:
      Const cBUTTON As String = cNAMESPACE & "#commandbutton"
      Replace that code with the following code:
      Const cBUTTON As String = cNAMESPACE & "#actionPertainsToEntireSchema" 
      Note The Smart Document #actionPertainsToEntireSchema control is considered a default control and applies to all elements in the Smart Document.
    5. On the File menu, click Make SimpleSample.dll, and then click OK in the Make Project dialog box.
  2. To install the SimpleSample Smart Document solution, follow these steps:
    1. 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.
    2. Start a new workbook in Excel 2003.
    3. On the Data menu, point to XML, and then click XML Expansion Packs.

      The XML Expansion Packs dialog box appears.
    4. 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.
    5. 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.
  3. Press ALT+F11 to start the Visual Basic Editor.
  4. On the Insert menu, click Module.

    Module1 is added to the project for the workbook.
  5. Add the following code to the code window for Module1:
    Public Sub AddXMLMap()
        ActiveWorkbook.XmlMaps.Add( _
            "C:\Program Files\Microsoft Office 2003 Developer Resources\" & _
            "Microsoft Office 2003 Smart Document SDK\Samples\SimpleSampleVB6\" & _
            "SimpleSample.xsd", "example").Name = "example_Map"
        'ActiveCell.Activate
    End Sub
    
    Public Sub DeleteXMLMap()
        ActiveWorkbook.XmlMaps("example_Map").Delete
        'ActiveCell.Activate
    End Sub
  6. Close the Visual Basic Editor to return to Excel 2003.
  7. To test the AddXMLMap macro and the DeleteXMLMap macro, follow these steps:
    1. 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.
    2. 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.
  8. 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
  9. Repeat step 7.

↑ Back to the top


Keywords: KB832116, kbnofix, kbautomation, kbofficesmartdoc, kbbug

↑ Back to the top

Article Info
Article ID : 832116
Revision : 3
Created on : 1/9/2004
Published on : 1/9/2004
Exists online : False
Views : 426