Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
sSql = "SELECT * INTO [Test$] IN [C:\test.xls] FROM [Sheet1$]"
Sub test()
Dim rsExcel As ADODB.Recordset, cnn As ADODB.Connection
Dim sPath As String, sDB As String, sConn As String, sSQL As String
sPath = ThisWorkbook.Path
sDB = Split(ThisWorkbook.Name, ".")(0)
Set rsExcel = New ADODB.Recordset
sConn = "Provider=Microsoft.Jet.OLEDB.4.0;"
sConn = sConn & "Data Source=" & sPath & "\" & sDB & ".xls;"
sConn = sConn & "Extended Properties=Excel 8.0;"
Set cnn = New ADODB.Connection
cnn.Open sConn
sSQL = "SELECT * INTO [Test] IN [C:\test.xls] FROM [Sheet1$]"
rsExcel.Open sSQL, cnn, adOpenDynamic, adLockOptimistic
rsExcel.Close
cnn.Close
Set rsExcel = Nothing
Set cnn = Nothing
End Sub
MS no longer supports the updating of excel files via SQL.