Click here to Skip to main content
13,140,231 members (48,299 online)
Rate this:
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 20:24pm
Bernhard Hiller 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.170915.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2017
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