I'm using visual basic 2010, I'm trying to use excel from Vb.net but I keep getting the following error when using the following code: type excel.application is not defined
dim xl as excel.application
dim wb as excel.workbook
dim ws as excel.worksheet
I've added the following references:
Microsoft Excel 14.0 Object Library
Microsoft Office 14.0 Object Library
Microsoft visual basic for application s extensibility 5.3
micrisoft.office.interop.excel
and then imported the following :
Imports Microsoft.Office.Core
Imports Microsoft.Office.Interop
Imports System.Data
I use word without any issues :
Dim appWord As Word.Application
Dim docWord As Word.Document
How come excel doesn't work the same way?
Visual Basic.NET
Last Comment
Jacques Bourgeois (James Burger)
8/22/2022 - Mon
kaufmed
I believe you also need the import:
Imports Microsoft.Office.Interop.Excel
kaufmed
Actually, strike that. I read your declarations incorrectly.