If the OleDb classes won't work with password protected Excel files u can use the code for its solution.
Imports Excel = Microsoft.Office.Interop.Excel ' at the top of the module
' add refference to Ms excel 11.0 object libray
' add refference to Ms office 11.0 object libray
Private Sub Button3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim xlsApp As Excel.Application
Dim xlsbook As Excel.Workbook
Dim xlsSheet As Excel.Worksheet
Dim m_Rw As Integer
Dim i As Integer
Dim j As Integer
xlsApp = CreateObject("Excel.Application")
xlsApp.Workbooks.Open("c:\Myfile.xls", , , ,My excelfile Password)
xlsbook = xlsApp.ActiveWorkbook
xlsSheet = xlsbook.Sheets(1)
dataGridview1.ColumnCount = xlsSheet.UsedRange.Columns.Count
dataGridview1.ColumnHeadersVisible = True
For i = 0 To xlsSheet.UsedRange.Columns.Count - 1
dataGridview1.Columns(i).Name = xlsSheet.Cells(1, i + 1).Value.ToString
Next
Dim var1(xlsSheet.UsedRange.Columns.Count) As String
m_Rw = 0
For i = 2 To xlsSheet.UsedRange.Rows.Count - 1
dataGridview1.Rows.Add()
For j = 0 To xlsSheet.UsedRange.Columns.Count - 1
If xlsSheet.Cells(i, j + 1).Value = Nothing Then
var1(j) = ""
Else
var1(j) = xlsSheet.Cells(i, j + 1).Value.ToString
End If
dataGridview1.Item(j, m_Rw).Value = var1(j)
Next j
m_Rw = m_Rw + 1
Next i
xlsSheet = Nothing
xlsbook = Nothing
xlsApp.Quit()
xlsApp = Nothing
Me.Cursor = Cursors.Default
End Sub
' please reply.Working or not, Thanks...