Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Deleting Excel Message/Dialog Boxes

Hi,

I am writing a VB macro for Excel 2000 and a step in it
deletes a worksheet in the file. When macro runs during
this step a dialog or message box appears stating
that 'Selected Sheet will be permanently deleted, OK,
Cancel.' If user selects 'OK' the macro continues but if
they hit 'Cancel' the macro fails.

Does anyone know of if it is possible to write a code so
that this dialog box does not appear? Or any other way
to bypass it?

Thanks for any assistance/advise
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default Deleting Excel Message/Dialog Boxes

Putting the following line of code near the top of your module will stop all
warning boxes from appearing:

Application.DisplayAlerts=False

Then at the end, place:

Application.DisplayAlerts=True

HTH
Mike

--
Michael J. Malinsky


"Rob" wrote in message
...
Hi,

I am writing a VB macro for Excel 2000 and a step in it
deletes a worksheet in the file. When macro runs during
this step a dialog or message box appears stating
that 'Selected Sheet will be permanently deleted, OK,
Cancel.' If user selects 'OK' the macro continues but if
they hit 'Cancel' the macro fails.

Does anyone know of if it is possible to write a code so
that this dialog box does not appear? Or any other way
to bypass it?

Thanks for any assistance/advise



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Deleting Excel Message/Dialog Boxes

Hi Rob

Application.DisplayAlerts = False
Activesheet.Delete
Application.DisplayAlerts = True


--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Rob" wrote in message ...
Hi,

I am writing a VB macro for Excel 2000 and a step in it
deletes a worksheet in the file. When macro runs during
this step a dialog or message box appears stating
that 'Selected Sheet will be permanently deleted, OK,
Cancel.' If user selects 'OK' the macro continues but if
they hit 'Cancel' the macro fails.

Does anyone know of if it is possible to write a code so
that this dialog box does not appear? Or any other way
to bypass it?

Thanks for any assistance/advise



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Deleting Excel Message/Dialog Boxes

Hi
try the following
sub foo()
.....
application.DisplayAlerts = False
'your code to delete something
application.DisplayAlerts = True

....
end sub


--
Regards
Frank Kabel
Frankfurt, Germany

Rob wrote:
Hi,

I am writing a VB macro for Excel 2000 and a step in it
deletes a worksheet in the file. When macro runs during
this step a dialog or message box appears stating
that 'Selected Sheet will be permanently deleted, OK,
Cancel.' If user selects 'OK' the macro continues but if
they hit 'Cancel' the macro fails.

Does anyone know of if it is possible to write a code so
that this dialog box does not appear? Or any other way
to bypass it?

Thanks for any assistance/advise

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 194
Default Deleting Excel Message/Dialog Boxes

DisplayAlerts = False. Don't forget to reset to = True.

Ed

"Rob" wrote in message
...
Hi,

I am writing a VB macro for Excel 2000 and a step in it
deletes a worksheet in the file. When macro runs during
this step a dialog or message box appears stating
that 'Selected Sheet will be permanently deleted, OK,
Cancel.' If user selects 'OK' the macro continues but if
they hit 'Cancel' the macro fails.

Does anyone know of if it is possible to write a code so
that this dialog box does not appear? Or any other way
to bypass it?

Thanks for any assistance/advise





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
Anchoring dialog boxes Excel 2007 smartgal Excel Discussion (Misc queries) 3 March 2nd 10 07:29 PM
A question about Excel 2003 Dialog Boxes GoBow777 New Users to Excel 4 August 13th 09 08:11 PM
Anchoring dialog boxes (Excel 2007) smartgal Excel Discussion (Misc queries) 0 July 29th 09 05:23 PM
Are there collapsible menu/dialog boxes for excel? LegoMyGeggo Excel Discussion (Misc queries) 0 June 25th 08 06:48 PM
Dialog boxes in Excel Robert Couchman Excel Programming 1 January 30th 04 12:17 PM


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

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"