With the reference to Excel, this code works OK in 2015:
But in VB.NET 2022, the [red]red[/red] line of code gives me "public member cells on type worksheet not found" error.
Any example of the bare-bone code to read values from Excel in VB.NET 2022?
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson
Code:
Imports Microsoft.Office.Interop
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim xlApp As New Excel.Application
Dim strExcel As String = "C:\Test\TestExcel.xlsx"
With xlApp
.Visible = True
.Workbooks.Open(strExcel, [ReadOnly]:=False)
With .Workbooks(1).Worksheets(1)
[red]Debug.Print(.cells(2, 2))[/red]
End With
End With
End Sub
End Class
But in VB.NET 2022, the [red]red[/red] line of code gives me "public member cells on type worksheet not found" error.
Any example of the bare-bone code to read values from Excel in VB.NET 2022?
---- Andy
"Hmm...they have the internet on computers now"--Homer Simpson