调用EXecl数据到msflexgrid中显示
Private Sub Command1_Click()
Dim xlsconn As New ADODB.Connection
Dim xlscmd As New ADODB.Command
Dim rs As New ADODB.Recordset
xlsconn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\TEST\test.xls;Extended Properties=excel 8.0;Persist Security Info=False"
xlsconn.Open
'提示对象变量未设置
Set rs = xlsconn.Execute("select * from [sheet1$]")
Set MSFlexGrid1.DataSource = rs
rs.Close
MSFlexGrid1.Refresh
End Sub