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.
Sub ToExcel()
Dim objExcel As Object
Dim objWorkbook As Object
Dim objWorksheet As Object
Set objExcel = CreateObject("Excel.Application")
'Create a new workbook to hold the data
Set objWorkbook = objExcel.Workbooks.Add
'# OR open an existing workbook
'# Set objWorkbook = objExcel.Workbooks.Open("C:\OldBook.xls", False, False)
'Grab the first worksheet in the workbook (Item 1)
Set objWorksheet = objWorkbook.Worksheets(1)
'# OR grab a specific worksheet
'# Set objWorksheet = objWorkbook.Worksheets("Sheet1")
'Drop the data staring at cell A1
objWorksheet.Range("A1").CopyFromRecordset [b]Me.Subform.Recordset[/b]
Set objWorksheet = Nothing
'Close and name the new workbook
objWorkbook.Close True, "[i]C:\TestOut.xls[/i]"
'# OR save the existing
'# objWorkbook.Close True
Set objWorkbook = Nothing
objExcel.Quit
Set objExcel = Nothing
End Sub
[b]Me.Subform.Recordset[/b]