Excel is an ISAM just like dBase. You can get at the data
using Excel automation or, if you don't have the full Excel installed but
have the Jet ISAM drivers on your user machine then you can open the sheets
just like opening a Jet file by using the OLEDB provider. There are some
limitations but getting the data for grid display (or INSERTs or UPDATES) is
pretty straight forward using Jet-SQL syntax and the special bracket syntax
as shown below for the Excel objects
The following shows very general proof of concept code, this opens the
connection and confirms that it is reading the data. Just use regular
ado.net to iterate and use the values to draw your shapes.
This example loads the values into a grid
The HDR=Yes in the connection string tells the provider that the first row
of the sheet has values that are used as "Column Names", if your sheet
doesn't have that then don't say Yes
Imports System.Data.Oledb
......
Dim cn As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\mytests\book1.xls;" & _
"Extended Properties=""Excel 8.0;HDR=Yes""")
Dim ds As New DataSet
Dim da As New OleDbDataAdapter("Select * from [Sheet1$]", cn)
cn.Open()
Try
da.Fill(ds)
MsgBox(ds.Tables.Count)
MsgBox(ds.Tables(0).Rows.Count)
grid1.DataSource = ds.Tables(0)
Catch ex As Exception
MsgBox(ex.ToString)
End Try
Hope that helps.
Robert Smith
Kirkland, WA
www.smithvoice.com