R
rmcompute
I set up the code listed below to create an Excel spreasheet from within
access VBA which worked successfully except it displayed a warning message
when I wanted to save the file. I entered DoCmd.SetWarnings False which did
not work. I then entered: xlApp.Application.DisplayAlerts = False which
also did not work.
Do you know how this warning message can be turned off from within Access
for creating an Excel worksheet ? The code is listed below
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)
'Turn of Excel Alerts
xlApp.Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
path + file, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
access VBA which worked successfully except it displayed a warning message
when I wanted to save the file. I entered DoCmd.SetWarnings False which did
not work. I then entered: xlApp.Application.DisplayAlerts = False which
also did not work.
Do you know how this warning message can be turned off from within Access
for creating an Excel worksheet ? The code is listed below
Dim xlApp As Excel.Application
Dim xlBook As Excel.Workbook
Dim xlSheet As Excel.Worksheet
Set xlApp = CreateObject("Excel.Application")
Set xlBook = xlApp.Workbooks.Add
Set xlSheet = xlBook.Worksheets(1)
'Turn of Excel Alerts
xlApp.Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
path + file, _
FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub