Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
"Variable not defined" error for form that does not initially exist... Alex[_34_] Excel Programming 1 February 17th 07 06:44 PM
STOP MACRO IF CELL "A1" IS EMPTY OR SHEET DOESN´T EXIST cbm Excel Programming 2 January 8th 07 10:00 AM
Questionnaire sheet: Select "yes" or "no," and only one can be selected bpatterson Excel Worksheet Functions 2 April 13th 06 11:04 PM
Suppress "Disable/Enable Macros" and Query Refresh dialog on open Sharon Excel Programming 2 January 18th 06 09:20 PM
Getting "compile error" "method or data member not found" on reinstall Bp Excel Programming 1 April 23rd 04 04:42 PM


All times are GMT +1. The time now is 04:52 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"