Smart Document installation fails silently when the targetApplication tag is not valid in Excel 2003 (832119)



The information in this article applies to:

  • Microsoft Office Excel 2003


Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

SYMPTOMS

When you try to install a Smart Document XML expansion pack (XEP) for Microsoft Office Excel 2003, the XEP does not appear in the list of available XML expansion packs, and you do not receive an error message.

CAUSE

This problem may occur if the XEP manifest contains a targetApplication tag that has a value that is not valid.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section of this article.

WORKAROUND

Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.

To work around this problem, follow these steps:
  1. Correct the value for the targetApplication tag in the Manifest.xml file.
  2. Delete the registry information for the expansion pack. To do this, follow these steps:
    1. Start Registry Editor.
    2. Locate the following registry location:

      HKEY_CURRENT_USER\Software\Microsoft\Schema Library
    3. Expand the Schema Library key and then locate the registry key that corresponds to the URI setting in your Manifest.xml file.
    4. Delete this registry key and all the subkeys for this registry key.
  3. Reinstall the corrected Manifest.xml file.

MORE INFORMATION

Steps to reproduce the problem

Note 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 install 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
  1. To create the Smart Document .dll file, follow these steps:
    1. Start Microsoft Visual Basic 6.0.
    2. On the File menu, click New Project.
    3. In the New Project dialog box, click ActiveX DLL, and then click Open.
    4. Type SDArt for the Project Name
    5. In the Class Module window, add the following code:
      Implements ISmartDocument
      
      'CONSTANTS
      'You must have one constant for the schema namespace, one constant for each
      'schema element that you want to provide smart document controls for
      'and actions for, and one constant for the total number of schema elements
      'that there are associated actions for.
      
      'Because XML is case-sensitive, the values
      'of these constants must be exact both in spelling and in case.
      'Therefore, if the textBox element is spelled with a
      'capital B in the XML schema, you must assign the
      'value of the cTEXTBOX constant as "cNAMESPACE & #textBox".
      
      'Namespace constant
      Const cNAMESPACE As String = "SDArt"
      
      'Element constants
      Const cTEXTBOX As String = cNAMESPACE & "#textbox"
      Const cBUTTON As String = cNAMESPACE & "#commandbutton"
      
      'Number of types (or element constants)
      Const cTYPES As Integer = 2
      
      'Constants
      Private strPath  As String
      Private strApp As String
      
      Private Sub ISmartDocument_SmartDocInitialize(ByVal ApplicationName As String, ByVal Document As Object, ByVal SolutionPath As String, ByVal SolutionRegKeyRoot As String)
      
          strPath = Document.Path & "\"
          strApp = Document.Application.Name
      
      End Sub
      
      Private Property Get ISmartDocument_SmartDocXmlTypeCount() As Long
          
          ISmartDocument_SmartDocXmlTypeCount = cTYPES
          
      End Property
      
      Private Property Get ISmartDocument_SmartDocXmlTypeName( _
              ByVal XMLTypeID As Long) As String
      
          Select Case XMLTypeID
              Case 1
                  ISmartDocument_SmartDocXmlTypeName = cTEXTBOX
              Case 2
                  ISmartDocument_SmartDocXmlTypeName = cBUTTON
              Case Else
      
          End Select
          
      End Property
      
      Private Property Get ISmartDocument_SmartDocXmlTypeCaption( _
              ByVal XMLTypeID As Long, ByVal LocaleID As Long) As String
                      
          Select Case XMLTypeID
              Case 1
                 ISmartDocument_SmartDocXmlTypeCaption = "Textbox"
              Case 2
                  ISmartDocument_SmartDocXmlTypeCaption = "Click"
              Case Else
          End Select
          
      End Property
      
      Private Property Get ISmartDocument_ControlCount( _
              ByVal XMLTypeName As String) As Long
                      
          Select Case XMLTypeName
              Case cTEXTBOX
                  ISmartDocument_ControlCount = 1
              Case cBUTTON
                  ISmartDocument_ControlCount = 1
              Case Else
              
          End Select
          
      End Property
      
      'The ControlID for the first control you add is 1.
      'For additional information about how to specify the ControlID, see the ControlID reference
      'topic in the References section of this SDK.
      Private Property Get ISmartDocument_ControlID( _
              ByVal XMLTypeName As String, _
              ByVal ControlIndex As Long) As Long
          
          Select Case XMLTypeName
              Case cTEXTBOX
                  ISmartDocument_ControlID = ControlIndex
              Case cBUTTON
                  ISmartDocument_ControlID = ControlIndex + 100
              Case Else
                  
          End Select
          
      End Property
      
      Private Property Get ISmartDocument_ControlNameFromID( _
              ByVal ControlID As Long) As String
          
      'This subroutine is intentionally left empty.
      End Property
      
      Private Property Get ISmartDocument_ControlCaptionFromID( _
              ByVal ControlID As Long, ByVal ApplicationName As String, _
              ByVal LocaleID As Long, ByVal Text As String, _
              ByVal Xml As String, ByVal Target As Object) As String
              
          Select Case ControlID
              Case 1
                 ISmartDocument_ControlCaptionFromID = _
                      "Enter your name:"
              Case 101
                  ISmartDocument_ControlCaptionFromID = _
                      "Test button"
              Case Else
              
          End Select
          
      End Property
      
      Private Property Get ISmartDocument_ControlTypeFromID( _
              ByVal ControlID As Long, _
              ByVal ApplicationName As String, _
              ByVal LocaleID As Long) As SmartTagLib.C_TYPE
      
          Select Case ControlID
              Case 1
                  ISmartDocument_ControlTypeFromID = C_TYPE_TEXTBOX
              Case 101
                  ISmartDocument_ControlTypeFromID = C_TYPE_BUTTON
              Case Else
              
          End Select
          
      End Property
      
      Private Sub ISmartDocument_PopulateActiveXProps(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal LocaleID As Long, ByVal Text As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As SmartTagLib.ISmartDocProperties, ByVal ActiveXPropBag As SmartTagLib.ISmartDocProperties)
      
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_PopulateCheckbox(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal LocaleID As Long, ByVal Text As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As SmartTagLib.ISmartDocProperties, Checked As Boolean)
      
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_PopulateDocumentFragment(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal LocaleID As Long, ByVal Text As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As SmartTagLib.ISmartDocProperties, DocumentFragment As String)
      
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_PopulateHelpContent(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal LocaleID As Long, ByVal Text As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As SmartTagLib.ISmartDocProperties, Content As String)
      
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_PopulateImage(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal LocaleID As Long, ByVal Text As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As SmartTagLib.ISmartDocProperties, ImageSrc As String)
      
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_PopulateListOrComboContent(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal LocaleID As Long, ByVal Text As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As SmartTagLib.ISmartDocProperties, List() As String, count As Long, InitialSelected As Long)
          
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_PopulateOther(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal LocaleID As Long, ByVal Text As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As SmartTagLib.ISmartDocProperties)
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_PopulateRadioGroup(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal LocaleID As Long, ByVal Text As String, ByVal Xml As String, ByVal Target As Object, ByVal Props As SmartTagLib.ISmartDocProperties, List() As String, count As Long, InitialSelected As Long)
          
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_PopulateTextboxContent( _
              ByVal ControlID As Long, ByVal ApplicationName As String, _
              ByVal LocaleID As Long, ByVal Text As String, _
              ByVal Xml As String, ByVal Target As Object, _
              ByVal Props As SmartTagLib.ISmartDocProperties, Value As String)
      
          'This subroutine is intentionally left empty.
      
      End Sub
      
      Private Sub ISmartDocument_ImageClick(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal Target As Object, ByVal Text As String, ByVal Xml As String, ByVal LocaleID As Long, ByVal XCoordinate As Long, ByVal YCoordinate As Long)
      
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_InvokeControl(ByVal ControlID As Long, ByVal ApplicationName As String, ByVal Target As Object, ByVal Text As String, ByVal Xml As String, ByVal LocaleID As Long)
          Dim objRange As Excel.Range
      
          Select Case ControlID
              Case 101
                  Dim oRange As Excel.Range
                  Dim count As Integer
                  Set oRange = Target
                  If oRange.Value = "" Then
                      oRange.Value = "temp"
                      count = oRange.SmartTags.count
                      oRange.Value = ""
                  Else
                      count = oRange.SmartTags.count
                  End If
                  MsgBox "The number elements in the SmartTags collection is " & count
              Case Else
              
          End Select
      
      End Sub
      
      Private Sub ISmartDocument_OnCheckboxChange(ByVal ControlID As Long, ByVal Target As Object, ByVal Checked As Boolean)
      
      'This subroutine is intentionally left empty.
      End Sub
      
      Private Sub ISmartDocument_OnListOrComboSelectChange(ByVal ControlID As Long, ByVal Target As Object, ByVal Selected As Long, ByVal Value As String)
      
      'This subroutine is intentionally left empty.
      
      End Sub
      
      Private Sub ISmartDocument_OnRadioGroupSelectChange(ByVal ControlID As Long, ByVal Target As Object, ByVal Selected As Long, ByVal Value As String)
      
      'This subroutine is intentionally left empty.
      End Sub
      
      'After you enter something in the text box,
      'the SimpleSample smart document displays a message that says "Hello."
      Private Sub ISmartDocument_OnTextboxContentChange( _
              ByVal ControlID As Long, ByVal Target As Object, _
              ByVal Value As String)
                      
          If Len(Value) > 0 Then
              MsgBox "Hello, " & Value
          End If
          
      End Sub
      
      Private Sub ISmartDocument_OnPaneUpdateComplete(ByVal Document As Object)
      
      'This subroutine is intentionally left empty.
      End Sub
    6. On the Project menu, click References. Click Microsoft Excel 11.0 Object Library, click Microsoft Smart Tags 2.0 Type Library, and then click OK.
    7. On the File menu, click Make SDArt.dll to build the Smart Document .dll file.
  2. To create the Manifest.xml file, follow these steps:
    1. Start Notepad, and then paste the following code in the Notepad document:
      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <manifest xmlns="http://schemas.microsoft.com/office/xmlexpansionpacks/2003">
      	<version>1.1</version>
      	<updateFrequency>20160</updateFrequency>
      	<uri>SDArt</uri>
      	<solution>
      		<solutionID><CLSID of the Smart Document dll></solutionID>
      		<type>smartDocument</type>
      		<alias lcid="*">SDArt</alias>
      		<targetApplication>Excl.Application</targetApplication>
      		<file>
      			<type>solutionActionHandler</type>
      			<version>1.0</version>
      			<filePath>SDArt.dll</filePath>
      			<CLSID><CLSID of the Smart Document dll></CLSID>
      			<regsvr32/>
      		</file>
      	</solution>
      	<solution>
      		<solutionID>schema</solutionID>
      		<type>schema</type>
      		<alias lcid="*">SDArt</alias>
      		<file>
      			<type>schema</type>
      			<version>1.0</version>
      			<filePath>SDArt.xsd</filePath>
      		</file>
      	</solution>
      </manifest>
    2. Start Registry Editor.
    3. Expand the HKEY_CLASSES_ROOT hive, and then locate the SDArt.Class1 key.
    4. Expand the SDArt.Class1 key, and then click the CLSID subkey.
    5. Copy the GUID for the CLSID. Replace the two occurrences of <CLSID of the Smart Document dll> in the code that you previously pasted in Notepad. Replace the two occurrences with the GUID of the .dll file.
    6. Save the file as Manifest.xml. Close the Manifest.xml file.
  3. To create the Schema file, follow these steps:
    1. Start Notepad, and then paste the following code in the Notepad document:
      <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
         xmlns="SDArt"
         targetNamespace="SDArt"
         elementFormDefault="qualified">
      
         <xsd:complexType name="SDArtType">
            <xsd:all>
               <xsd:element name="textbox" type="xsd:string"/>
               <xsd:element name="commandbutton" type="xsd:string"/>
            </xsd:all>
         </xsd:complexType>
      
         <xsd:element name="SDArt" type="SDArtType"/>
      
      </xsd:schema>
    2. Save the file as SDArt.xsd. Close the SDArt.xsd file.
  4. To test the Smart Document, follow these steps:
    1. Locate the DisableManifestSecurityCheck.reg file that is installed with the Office 2003 Smart Document SDK. Double-click DisableManifestSecurityCheck.reg to add the registry key that disables the manifest security check.
    2. Start Excel 2003.
    3. On the Data menu, point to XML, and then click XML Expansion Packs.
    4. In the XML Expansion Packs dialog box, click Add.
    5. Locate the Manifest.xml file that you previously created. Click Manifest.xml, and then click Open.

      If you receive a message to re-enable the XML expansion pack security, click No.

      When the loading process is completed, notice that the XEP was not added to the Available XML expansion packs list and you do not receive an error message.

      Note The steps in the "Workaround" section correct this problem.

Modification Type:MinorLast Reviewed:1/21/2004
Keywords:kbBug kbOfficeSmartDoc KB832119 kbAudDeveloper