Imports System.Data.OleDb
这是我 .Net下写的读取excel一个指定worksheet的例子
你改成vb6的对应对象 控件 和语法就是了 原理一样的
Public Function Pr_LoadXLSSheetList(ByVal strFile As String) As DataSet
Dim strSql As String, sqlCmd As New SqlCommand()
Dim strError As String, strConn As String
Dim ds As New DataSet()
Dim strCon As String, strCmd As String
strCon = " Provider = Microsoft.Jet.OLEDB.4.0 ; Data Source = " + strFile + ";Extended Properties=Excel 8.0"
strCmd = "SELECT * FROM [list$]"
Dim sqlCon As New OleDbConnection(strCon), sqlAdp As OleDbDataAdapter, mycmd As OleDbCommand
mycmd = New OleDbCommand(strCmd, sqlCon)
sqlAdp = New OleDbDataAdapter(mycmd)
sqlCon.Open()
Try
sqlAdp.Fill(ds, "list")
Catch e As Exception
strError = ReturnErrorMessage(e.ToString.Trim)
End Try
sqlCon.Close()
Return ds
End Function