Create Excel in VB.NET
-
I have to programing with VB.NET and Excel. I use Microsoft Development Environment 2003 and Excel 2000. But I cannot create a workbook: Dim xlsApp As Excel.Application Dim xlsWB As Excel.Workbook xlsApp = New Excel.Application xlsWB = xlsApp.Workbooks.Add() <-- error in this line The error message is: "An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred " and "Additional information: Old format or invalid type library." I added the Microsoft Excel 9.0 Object Library (excel9.olb) as a reference and use Imports Excel. Anyone give me a suggestion? Thank you
-
I have to programing with VB.NET and Excel. I use Microsoft Development Environment 2003 and Excel 2000. But I cannot create a workbook: Dim xlsApp As Excel.Application Dim xlsWB As Excel.Workbook xlsApp = New Excel.Application xlsWB = xlsApp.Workbooks.Add() <-- error in this line The error message is: "An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred " and "Additional information: Old format or invalid type library." I added the Microsoft Excel 9.0 Object Library (excel9.olb) as a reference and use Imports Excel. Anyone give me a suggestion? Thank you
It looks like you referenced the Excel 9.0 Object library, but are using the Excel 10 (or better Primary Interop Assemblies). Set the reference to Excel 10.0 instead and see what happens. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-
It looks like you referenced the Excel 9.0 Object library, but are using the Excel 10 (or better Primary Interop Assemblies). Set the reference to Excel 10.0 instead and see what happens. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
I'm using Microsoft Office 2000. When this error occurs, I installed the Office 2000 SP3, but the problem still exists