Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Delete Spreadsheet without Error

Hi.

I currently am deleting sheets in a macro with the command:

ActiveWindow.SelectedSheets.Delete

Each time it is executed, it prompts me with a message
that says "Data may exist ..."

How do I tell my macro to skip this?

Thanks,
Mike.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Delete Spreadsheet without Error

Possibly

application.DisplayAlerts = False
ActiveWindow.Selectedsheets.Delete
Application.DisplayAlerts = True

--
Regards,
Tom Ogilvy

"Mike D." wrote in message
...
Hi.

I currently am deleting sheets in a macro with the command:

ActiveWindow.SelectedSheets.Delete

Each time it is executed, it prompts me with a message
that says "Data may exist ..."

How do I tell my macro to skip this?

Thanks,
Mike.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,089
Default Delete Spreadsheet without Error

Mike

you could try:

Application.DisplayAlerts = False
' your code
Application.DisplayAlerts = True

Regards

Trevor


"Mike D." wrote in message
...
Hi.

I currently am deleting sheets in a macro with the command:

ActiveWindow.SelectedSheets.Delete

Each time it is executed, it prompts me with a message
that says "Data may exist ..."

How do I tell my macro to skip this?

Thanks,
Mike.



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Delete Spreadsheet without Error

Hi
try
application.displayalerts=false
ActiveWindow.SelectedSheets.Delete
application.displayalerts=true

--
Regards
Frank Kabel
Frankfurt, Germany


Mike D. wrote:
Hi.

I currently am deleting sheets in a macro with the command:

ActiveWindow.SelectedSheets.Delete

Each time it is executed, it prompts me with a message
that says "Data may exist ..."

How do I tell my macro to skip this?

Thanks,
Mike.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Delete Spreadsheet without Error

Thanks, Tom, Trevor, and Frank! This worked.


-----Original Message-----
Hi.

I currently am deleting sheets in a macro with the

command:

ActiveWindow.SelectedSheets.Delete

Each time it is executed, it prompts me with a message
that says "Data may exist ..."

How do I tell my macro to skip this?

Thanks,
Mike.

.

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
Graphics won't delete from spreadsheet kevinla Excel Discussion (Misc queries) 3 November 21st 06 07:29 AM
delete all the spreadsheet Nader Excel Discussion (Misc queries) 2 July 21st 05 02:56 PM
How do I delete a row from a spreadsheet if criteria is not met i. wonderboy55 Excel Worksheet Functions 1 April 26th 05 03:43 PM
Is there a way to insert a formula, password or macro in an excel spreadsheet that will automatically delete the spreadsheet? oil_driller Excel Discussion (Misc queries) 1 February 8th 05 09:34 AM
Macro to Delete a Spreadsheet Suzanne[_3_] Excel Programming 0 October 16th 03 06:11 PM


All times are GMT +1. The time now is 06:27 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"