Click here to Skip to main content
12,503,676 members (31,712 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
Comments
Bernhard Hiller 21-Feb-13 2:51am
   
Also Microsoft recommends the 32bit version of Excel - because of compatibility issues. See http://office.microsoft.com/en-001/excel-help/choose-the-32-bit-or-64-bit-version-of-office-HA010369476.aspx
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 | Mobile
Web02 | 2.8.160919.1 | Last Updated 21 Feb 2013
Copyright © CodeProject, 1999-2016
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