Microsoft KB Archive/832119

= Smart Document installation fails silently when the targetApplication tag is not valid in Excel 2003 =

Article ID: 832119

Article Last Modified on 1/21/2004

-

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 &quot;Applies to&quot; 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:  Correct the value for the targetApplication tag in the Manifest.xml file. Delete the registry information for the expansion pack. To do this, follow these steps:  Start Registry Editor. Locate the following registry location:

 Expand the Schema Library key and then locate the registry key that corresponds to the URI setting in your Manifest.xml file.</li> Delete this registry key and all the subkeys for this registry key.</li></ol> </li> Reinstall the corrected Manifest.xml file.</li></ol>

<div class="moreinformation_section">

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 <ol> To create the Smart Document .dll file, follow these steps: <ol style="list-style-type: lower-alpha;"> Start Microsoft Visual Basic 6.0.</li> On the File menu, click New Project.</li> In the New Project dialog box, click ActiveX DLL, and then click Open.</li> Type SDArt for the Project Name</li>  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 &quot;cNAMESPACE & #textBox&quot;.

'Namespace constant Const cNAMESPACE As String = &quot;SDArt&quot;

'Element constants Const cTEXTBOX As String = cNAMESPACE & &quot;#textbox&quot; Const cBUTTON As String = cNAMESPACE & &quot;#commandbutton&quot;

'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 & &quot;\&quot; 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 = &quot;Textbox&quot; Case 2 ISmartDocument_SmartDocXmlTypeCaption = &quot;Click&quot; 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 = _ &quot;Enter your name:&quot; Case 101 ISmartDocument_ControlCaptionFromID = _ &quot;Test button&quot; 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 = &quot;&quot; Then oRange.Value = &quot;temp&quot; count = oRange.SmartTags.count oRange.Value = &quot;&quot; Else count = oRange.SmartTags.count End If           MsgBox &quot;The number elements in the SmartTags collection is &quot; & 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 &quot;Hello.&quot; Private Sub ISmartDocument_OnTextboxContentChange( _       ByVal ControlID As Long, ByVal Target As Object, _        ByVal Value As String) If Len(Value) > 0 Then MsgBox &quot;Hello, &quot; & Value End If End Sub

Private Sub ISmartDocument_OnPaneUpdateComplete(ByVal Document As Object)

'This subroutine is intentionally left empty. End Sub </li> 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.</li> On the File menu, click Make SDArt.dll to build the Smart Document .dll file.</li></ol> </li> To create the Manifest.xml file, follow these steps: <ol style="list-style-type: lower-alpha;">  Start Notepad, and then paste the following code in the Notepad document: <?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; standalone=&quot;no&quot;?> <manifest xmlns=&quot;http://schemas.microsoft.com/office/xmlexpansionpacks/2003&quot;> 1.1    <updateFrequency>20160</updateFrequency> SDArt <solutionID><CLSID of the Smart Document dll></solutionID> smartDocument <alias lcid=&quot;*&quot;>SDArt <targetApplication>Excl.Application</targetApplication> solutionActionHandler 1.0            <filePath>SDArt.dll</filePath> <CLSID><CLSID of the Smart Document dll></CLSID> <solutionID>schema</solutionID> schema <alias lcid=&quot;*&quot;>SDArt schema 1.0            <filePath>SDArt.xsd</filePath> </li> Start Registry Editor.</li> Expand the  hive, and then locate the SDArt.Class1 key.</li> Expand the SDArt.Class1 key, and then click the CLSID subkey.</li> 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.</li> <li>Save the file as Manifest.xml. Close the Manifest.xml file.</li></ol> </li> <li>To create the Schema file, follow these steps: <ol style="list-style-type: lower-alpha;"> <li> Start Notepad, and then paste the following code in the Notepad document: <xsd:schema xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns=&quot;SDArt&quot; targetNamespace=&quot;SDArt&quot; elementFormDefault=&quot;qualified&quot;>

<xsd:complexType name=&quot;SDArtType&quot;> <xsd:all> <xsd:element name=&quot;textbox&quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot;commandbutton&quot; type=&quot;xsd:string&quot;/> </xsd:all> </xsd:complexType>

<xsd:element name=&quot;SDArt&quot; type=&quot;SDArtType&quot;/>

</xsd:schema> </li> <li>Save the file as SDArt.xsd. Close the SDArt.xsd file.</li></ol> </li> <li>To test the Smart Document, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>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.</li> <li>Start Excel 2003.</li> <li>On the Data menu, point to XML, and then click XML Expansion Packs.</li> <li>In the XML Expansion Packs dialog box, click Add.</li> <li>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 &quot;Workaround&quot; section correct this problem.</li></ol> </li></ol>

Keywords: kbbug kbofficesmartdoc KB832119

-

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

© Microsoft Corporation. All rights reserved.