Using Excel 2010, Visual Studio Express 2013.
I have added the Reference Object Library in Visual Studio for Microsoft Excel 14.0
Imports Microsoft.Office.Core
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim oXL As Excel.Application
Dim oWB As Excel.Workbook
Dim oSheet As Excel.Worksheet
Dim oRng As Excel.Range
' Start Excel and get Application object.
oXL = CreateObject("Excel.Application")
oXL.Visible = True
End Sub
End Class
However it gives me the following error:
Type 'Excel.Application' is not defined.
Type 'Excel.Workbook' is not defined.
Type 'Excel.Worksheet' is not defined.
Type 'Excel.Range' is not defined.
If I am using a wrong reference library for the excel version, please show how I can go about adding the proper object library to the list.