我想将一个范围A1:A41插入Access表中。它显示错误数据类型不匹配。请建议。
Sub EBD_Uploader()
Dim cn As Object
Dim rs As Object
Dim StrSql As String
Dim strConnection As String
Row = 3
Set cn = CreateObject("ADODB.Connection")
strConnection = "Provider=Microsoft.ACE.OLEDB.12.0;" & _
"Data Source=C:\BEO.accdb;"
cn.Open strConnection
Do While Cells(Row, 1) <> ""
Set Rng = Range(Cells(Row, 1), Cells(Row, 41))
StrSql = "INSERT INTO EDB VALUES ('" & Rng & "') "
Set rs = cn.Execute(StrSql)
Row = Row + 1
Loop
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub