Opening an Excel Spreadsheet with ADO : Excel ADO « Excel « VBA / Excel / Access / Word






Opening an Excel Spreadsheet with ADO

 
Sub Open_ExcelSpread()
   Dim conn As ADODB.Connection
   Set conn = New ADODB.Connection
   conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
       "Data Source=" & CurrentProject.Path & _
       "\Report.xls;" & _
       "Extended Properties=Excel 8.0;"
   conn.Close
   Set conn = Nothing
End Sub

 








Related examples in the same category

1.Insert a row to a worksheet by using the SQL statement
2.Use ADO to read the data from Access database to Excel
3.open the Excel worksheet, create a recordset with the data in the sheet, and then print it in the Immediate window.
4.Excel based database