Return to Snippet

Revision: 8972
at October 16, 2008 09:09 by goo


Initial Code
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

Initial URL
http://www.msaccesstips.com/2006/12/create-excel-word-file-from-access.shtml

Initial Description

                                

Initial Title
ACCESS Create Excel document

Initial Tags
excel

Initial Language
Visual Basic