farifari 0 Newbie Poster

any one here can tell me this,
I am doing the coding like this,, but only excel file is opening not the complete spreadsheet on which i have done work is opening,,it shows path error while running, check n answer to my question
coding is below:


Imports Microsoft.Office.Interop
Imports System.IO


Public Class Form1


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim xlsApp As Excel.Application
Dim xlsWB As Excel.Workbook
Dim xlsSheet As Excel.Worksheet
Dim xlsCell As Excel.Range

xlsApp = New Excel.Application
xlsApp.Visible = True
xlsWB = xlsApp.Workbooks.Open("C:\Desktop\Book3.xlsx")
xlsSheet = xlsWB.Worksheets(1)
xlsCell = xlsSheet.Range("A1")
MsgBox(xlsCell.Value)

End Sub

End Class

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.