vb.net can't read the excel file directly -- use Excel Automation, which launches Excel to do it for you. There are lots of tutorials if you just google for "vb.net excel automation". It assumes Excel is installed on the computer. If it isn't, then I think you are SOL.
Here is a more in-depts explanation which you might want to read.
The only other alternative I know about is to have Excel export the file into a CVS format text file, which means each cell on a row is separated with commas or tabs. Then your vb.net program can just read it as normal text.
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button1.Click
Dim oExcel As Object = CreateObject("Excel.Application")
Dim oBook As Object = oExcel.Workbooks.Open("c:/Book1.xlsx")
Dim oSheet As Object = oBook.Worksheets(1)
Dim i As Integer
Dim cell As String
For i = 0 To 10
'set cell name, e.g. A1, A2, etc
cell = "A" & Convert.ToString(i + 1)
' get cell data from Excel
cell = oSheet.Range(cell).Value
' add the data to Listbox1
Hi, as I was told that my code doesn’t scale well at all, I thought perhaps I’d try to get a better understanding of interfaces/abstract classes and classes and the relationship between them.
I don’t want at this stage work on a big separate project as I've already got plenty ...
I am writing a java program that needs to execute shell commands, so I wrote a function that would take the command to execute as a string (ie: "mkdir ~/Folder1") and execute that command with the shell. Here is the function:
Runtime run = Runtime.getRuntime();
Process pr = ...
Hi. I have a form with list box : lst_product, datagridview : grd_order and button: btn_addline. lst_product has a list of product ids selected from database (MS Acess 2013) , grd_order is by default empty except for 2 headers and btn_addline adds rows to grd_order.