I've encountered a problem when developing on MS Visual Web Developer 2008 Express Ed.
Developing ASP.NET C# on Windows7 64 bit OS.
I'm trying to open an Excel document, but it gives me Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
I did configured the build to all processors (Any CPU, x64, x86) but it doesn't work. I searched the answer on the internet but couldn't find out how to handle it.
The weird thing is the same code worked on the same system when I developed on Microsoft Visual C# 2010 Express! how come? isn't it the same dll working behind?
Do I need to change that COM dll so it'll work on x64 system?
Please help me, what can I do?
My code is:
using Excel = Microsoft.Office.Interop.Excel;
xlApp = new Excel.Application();
__Log("Openning " + excelFileName);
xlWorkBook = xlApp.Workbooks.Open(excelFileName, 0, true, 5, "", "", true, Microsoft.Office.Interop.Excel.XlPlatform.xlWindows, "", false, false, 0, true, 1, 0);
xlWorkSheet = (Excel.Worksheet)xlWorkBook.Worksheets.get_Item(2);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…