Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default deleting sheet: how to omit warning

Hello there,

when I call sheets(xyz).delete to delete a sheet from a workbook I
get a warning at runtime asking if I am sure that I want that sheet
deleted. (I wouldn't have coded it that way if I didn't want it deleted :-))
My question: How do I omit this warning at runtime of my vba script?

thanks
Marco

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default deleting sheet: how to omit warning

Application.DisplayAlerts = False

....will turn off such warnings

Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
Hello there,

when I call sheets(xyz).delete to delete a sheet from a

workbook I
get a warning at runtime asking if I am sure that I want

that sheet
deleted. (I wouldn't have coded it that way if I didn't

want it deleted :-))
My question: How do I omit this warning at runtime of my

vba script?

thanks
Marco

.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default deleting sheet: how to omit warning

Use Application.DisplayAlerts = False

This will block all alerts until the macro ends so you may want to set it to
True after the delete.

--
Jim Rech
Excel MVP


  #4   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default deleting sheet: how to omit warning

Don't forget to turn it back on again at the end!
-----Original Message-----
Application.DisplayAlerts = False

....will turn off such warnings

Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
Hello there,

when I call sheets(xyz).delete to delete a sheet from a

workbook I
get a warning at runtime asking if I am sure that I want

that sheet
deleted. (I wouldn't have coded it that way if I didn't

want it deleted :-))
My question: How do I omit this warning at runtime of my

vba script?

thanks
Marco

.

.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 691
Default deleting sheet: how to omit warning

You might find the following example of some interest, I use it to
delete sheets that look like I have no further use for, but it will not
delete sheets that have event macros, which may have something
still of interest.

Delete Active Sheet if name begins with "sheet" (#DeleteThisSheet)
http://www.mvps.org/dmcritchie/excel...eleteThisSheet

Information on event macros on my event.htm page.

---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

wrote in message ...
Don't forget to turn it back on again at the end!
-----Original Message-----
Application.DisplayAlerts = False

....will turn off such warnings

Patrick Molloy
Microsoft Excel MVP
-----Original Message-----
Hello there,

when I call sheets(xyz).delete to delete a sheet from a

workbook I
get a warning at runtime asking if I am sure that I want

that sheet
deleted. (I wouldn't have coded it that way if I didn't

want it deleted :-))
My question: How do I omit this warning at runtime of my

vba script?

thanks
Marco

.

.



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
Warning upon closing sheet stevieboy1313 Excel Worksheet Functions 6 April 22nd 08 06:53 PM
How to prevent warning messages on protected work sheet. Dannycol Excel Worksheet Functions 3 April 5th 06 09:07 PM
What is the VBA code to delete a sheet without warning message? [email protected] Excel Discussion (Misc queries) 2 August 9th 05 04:16 PM
macro warning persists even after deleting all macros Todd Excel Discussion (Misc queries) 3 July 25th 05 10:12 PM
Deleting a Sheet Abdul Salam Excel Programming 1 July 29th 03 12:43 AM


All times are GMT +1. The time now is 07:36 PM.

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

About Us

"It's about Microsoft Excel"