![]() |
Suppress Error Dialog: "Data may exist in the sheet(s) selected for deleting...."
I'm running this code:
-------------------------------------------------------------- DoCmd.SetWarnings False On Error Resume Next With mySS .Worksheets("Sheet1").Delete .Worksheets("Sheet2").Delete .Worksheets("Sheet3").Delete End With On Error GoTo ProjectedPayments_SpreadsheetCreate_err DoCmd.SetWarnings True -------------------------------------------------------------- in an effort to clean up any empty sheets the user's Excel options may have automagically created when my code creates/populates a .XLS. Similar code hasn't given me any trouble, but in this particular application, it's causing Excel to pop a warning/confirmation dialog: "Data may exist in the sheet(s) selected for deleting. To permanently delete the data, press Delete." I guess I'm doing something to make Excel think I've populated one or more cells in the sheets in question. Is there some way for me to suppress that dialog so the user doesn't have to see/respond to it? -- PeteCresswell |
Suppress Error Dialog: "Data may exist in the sheet(s) selected for deleting...."
Application.DisplayAlerts = False
-- Jim "(PeteCresswell)" wrote in message ... | I'm running this code: | -------------------------------------------------------------- | DoCmd.SetWarnings False | On Error Resume Next | With mySS | .Worksheets("Sheet1").Delete | .Worksheets("Sheet2").Delete | .Worksheets("Sheet3").Delete | End With | On Error GoTo ProjectedPayments_SpreadsheetCreate_err | DoCmd.SetWarnings True | -------------------------------------------------------------- | | in an effort to clean up any empty sheets the user's Excel | options may have automagically created when my code | creates/populates a .XLS. | | | Similar code hasn't given me any trouble, but in this particular | application, it's causing Excel to pop a warning/confirmation | dialog: | | "Data may exist in the sheet(s) selected for deleting. To | permanently delete the data, press Delete." | | | I guess I'm doing something to make Excel think I've populated | one or more cells in the sheets in question. | | Is there some way for me to suppress that dialog so the user | doesn't have to see/respond to it? | -- | PeteCresswell |
Suppress Error Dialog: "Data may exist in the sheet(s) selected for deleting...."
Per Jim Rech:
Application.DisplayAlerts = False Now that was *quick*... -) Thanks. -- PeteCresswell |
All times are GMT +1. The time now is 05:25 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com