Click here to Skip to main content
11,438,226 members (63,836 online)
Rate this: bad
Please Sign up or sign in to vote.
I have Open a excel file using C#.NET (COM application) and trying to get it's HInstance but it gives me error on 64 bit EXCEL 2010.

Here is my code

 objExelApp = new Excel.ApplicationClass();
 objWorkbook = objExelApp.Workbooks.Add(misValue);
 iHinstance = objExelApp.Hinstance; //This line gives error
 objWorksheet = (Excel.Worksheet)(objWorkbook.Worksheets.get_Item(1));

Error : "Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))"

I have compile DLL with X64 but no luck.

Please help me to resolve the issue

Thanks in advance
Posted 20-Feb-13 21:24pm
Bernhard Hiller at 21-Feb-13 2:51am
Also Microsoft recommends the 32bit version of Excel - because of compatibility issues. See
Perhaps you need a different primary interop assembly generated from the 64 bit version. And adjust variable types etc....

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Advertise | Privacy | Mobile
Web01 | 2.8.150506.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100