hi guys
heres the problem i have a excell file which reads into a datagrid now everything works fine BUT yes theres alwas a but i want to password the excell file and have the password passed through to excell so far i have pulled out my hair teeth and now onto my toe nails any help would be brill thanks code attached
'TODO: This line of code loads data into the 'PhonedetailsDataSet.site' table. You can move, or remove it, as needed.
Me.SiteTableAdapter.Fill(Me.PhonedetailsDataSet.site)
Try
Dim MyConnection As System.Data.OleDb.OleDbConnection
Dim DtSet As System.Data.DataSet
Dim MyCommand As System.Data.OleDb.OleDbDataAdapter
MyConnection = New System.Data.OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Users\stephen\Documents\phonelog.xls;Extended Properties=""Excel 8.0;HDR=YES;""")
MyCommand = New System.Data.OleDb.OleDbDataAdapter _
("select * from [Sheet1$]", MyConnection)
DtSet = New System.Data.DataSet
MyCommand.Fill(DtSet)
DataGridView1.DataSource = DtSet.Tables(0)
MyConnection.Close()
Catch ex As Exception
MsgBox(ex.ToString)
End Try