none
Unable to attach managed smart document ( xml expansion pack ) RRS feed

  • Question

  • Hi,

    I think that I have done all that is required but I am getting the extremely helpful "The XML expansion pack or the Smart Document program is missing or invalid...." error message.

    The smart document is for a very simple schema noteSchema.xsd ( displayed later )

    I am running Windows 7, 64 bit, dll in C#.  I have both Excel 2010 and the Excel 2013 preview and as such the PIA's I referenced, the debug "Start external program" path and the targetApplication manifest element were changed appropriately since I tested with both.

    The steps taken:

    1) Created dll

    References

    Microsoft.Office.Interop.Excel

    Microsoft.Office.Interop.SmartTag

    Office

    Namespace SmartDocByDll, class name implementing ISmartDocument is MySmartDocument.

    All methods of the interface are implemented ( although I have changed their order to replicate the order in which the methods are called )

    I have added some additional private methods and created classes for a mapped element and the associated controls.

    The dll is in the My Computer Zone and gets full trust

    2) Create manifest ( note that I used <runFromServer>True</runFromServer> instead of <runFromServer/>  as this is the format the samples were using ).  ( Displaying the unsigned version for brevity )

    <?xml version="1.0"?>

    <manifest xmlns="http://schemas.microsoft.com/office/xmlexpansionpacks/2003">

    <version>1.0</version>

    <updateFrequency>20160</updateFrequency>

    <uri>NoteNamespace</uri>

    <solution>

    <solutionID>{A8917752-F924-4293-A778-F7138E837D2A}</solutionID>

    <type>smartDocument</type>

    <alias lcid="*">Note smart document from managed dll</alias>

    <targetApplication>Excel.Application</targetApplication>

    <file>

    <runFromServer>True</runFromServer>

    <type>solutionActionHandler</type>

    <managed/>

    <version>1.0</version>

    <filePath>SmartDocByDll.dll</filePath>

    <CLSNAME>SmartDocByDll.MySmartDocument</CLSNAME>

    </file>

    </solution>

    </manifest>

    3) Manifest saved to ...bin/debug

    4) Run sdlint - Verification complete, is internally consistent

    5) Run xmlsign on the manifest using a certificate that is in the Trusted Root Certificate Authorities for the Current User - Succeeded

    6) Set Visual Studio for debugging. 

     Start External Program - C:\Program Files\Microsoft Office 15\root\office15\excel.exe

    Break when a clr exception is thrown

    Also added System.Diagnostics.Debugger.Break() inside SmartDocInitialize

    7) Start debugging

    8) Added XmlMap to noteSchema.xsd located in My Documents

    <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="NoteNamespace" xmlns = "NoteNamespace" elementFormDefault="qualified">

    <xs:element name="note">

    <xs:complexType>

    <xs:sequence>

    <xs:element name="to" type="xs:string"/>

    <xs:element name="from" type="xs:string"/>

    <xs:element name="heading" type="xs:string"/>

    <xs:element name="body" type="xs:string"/>

    </xs:sequence>

    </xs:complexType>

    </xs:element>

    </xs:schema>

    9) Mapped schema elements to cells

    10) Imported valid xml file

    11) Add expansion pack ( manifest.xml )

    12) dialog - Trust all documents from this publisher

    13) Attach - see in status bar C:\Program Files (x86)\Microsoft Office\Office14\ADDINS\OTKLOADR.dll

    14) Error message - ( do not break into code )

    Please help !

    Many thanks in advance,

    Tony Hallett

    Tuesday, January 8, 2013 5:49 PM

All replies