Last edited:
Hi,
Sorry, but we cannot see the picture you have uploaded. if you use the Go Advanced option when posting you can use Manage Attachments to upload the file.
Cheers,
Ian
Imports Microsoft.Office.Interop
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Dim xlApp As New Excel.Application
Dim xlWorkBook As Excel.Workbook
Dim xlWorkSheet As Excel.Worksheet
xlWorkBook = xlApp.Workbooks.Open("d:\temp\Book1.xls")
xlWorkSheet = xlWorkBook.Worksheets("sheet1")
For xlRow As Integer = 1 To xlWorkSheet.UsedRange.Rows.Count
For xlCol As Integer = 1 To xlWorkSheet.UsedRange.Columns.Count
MsgBox(xlWorkSheet.Cells(xlRow, xlCol).value)
Next
Next
xlWorkBook.Close()
xlApp.Quit()
End Sub
Hi,
Apologies, my mistake, I forgot to mention you need to add a reference to Microsoft.Office.Interop.Excel. In solution explorer, select add reference, Select .NET and then find the component I mentioned.
Cheers,
Ian
I think our posts overlapped. Have you picked up and tried my previous post yet?
Ian
it appears to work but i get the namefile wrong
Hi,
Sorry, I do not understand:-
Can you better explain what you mean.
Cheers,
Ian
Not really sure here then.
Can you post the code that you have so far including your Imports statement and tell me the exact the name of the component that you eventually added in your reference.
I need to leave for a while now, but I will try and have a look again later.
Cheers,
Ian