/ Published in: Visual Basic
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Public Sub CreateExcelSheet() Dim ExcelSheet As Object On Error goto CreateExcelSheet_Err Set ExcelSheet = CreateObject("Excel.Sheet") _ ExcelSheet.Application.Visible = True ExcelSheet.Application.Cells(1, 1).Value = "This is Column A, _ row 1"ExcelSheet.SaveAs "C:\TEST.XLS" ExcelSheet.Application.Quit Set ExcelSheet = Nothing CreateExcelSheet_Exit: Exit Sub CreateExcelSheet_Err: Msgbox Err.Description,,"CreateExcelSheet" Resume CreateExcelSheet_Exit End Sub
URL: http://www.msaccesstips.com/2006/12/create-excel-word-file-from-access.shtml