R
Ray Milhon
I have the following in my Access Database
Private appExcel As Excel.Application
Private wbk As Excel.Workbook, strfilename As String
Private wks As Excel.Worksheet
strfilename = "book1"
Set appExcel = Excel.Application
Set wbk = appExcel.Workbooks.Open(strfilename)
Set wks = appExcel.Worksheets("sheet1")
If the file exists this works perfectly. If the file does not exist it
errors.
Eventually I want strfilename to be calculated based on the user so I will
be able to tell who the file was created by.
How do I create a new Excel file from VBA in Access.
I don't see a property under AppExcel.workbooks for new or create.
Private appExcel As Excel.Application
Private wbk As Excel.Workbook, strfilename As String
Private wks As Excel.Worksheet
strfilename = "book1"
Set appExcel = Excel.Application
Set wbk = appExcel.Workbooks.Open(strfilename)
Set wks = appExcel.Worksheets("sheet1")
If the file exists this works perfectly. If the file does not exist it
errors.
Eventually I want strfilename to be calculated based on the user so I will
be able to tell who the file was created by.
How do I create a new Excel file from VBA in Access.
I don't see a property under AppExcel.workbooks for new or create.