none
Send variables from C# App to Excel document RRS feed

  • Question

  • Hi

    I try to send variables from C# App to Excel document using Microsoft.Office.Interop.Excel.

    Word document has a Variables property for custom variables.

    I use Microsoft.Office.Core.DocumentProperties for Excel document.

    DocumentProperties variables = (DocumentProperties)workbook.CustomDocumentProperties;
    But I get an exception:

    Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.Office.Core.DocumentProperties'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{2DF8D04D-5BFA-101B-BDE5-00AA0044DE52}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).


    Does Excel have anything solution to send variables from C# App to Excel document ?

    Thanks

    Monday, October 20, 2014 9:35 AM

Answers