#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default msgbox

I want to delete a worksheet, every time I open a workbook, but how can I
stop the msgbox from popping up with the message " Data may exist...... ?

Regards Kjeldc
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default msgbox

Just what I needed. Thanks Jim.

"Jim Thomlinson" skrev:

You need to toggle the display alerts setting...
Application.DisplayAlerts = False
Application.DisplayAlerts = True
As with any application level setting you are best off to use an error
handler something like this (in case your code crashes you need to reset the
application)

sub Stuff()
On error goto ErrorHandler
Application.DisplayAlerts = False

Sheet1.Delete
ErrorHandler:
Application.DisplayAlerts = True
end sub

--
HTH...

Jim Thomlinson


"Kjeldc" wrote:

I want to delete a worksheet, every time I open a workbook, but how can I
stop the msgbox from popping up with the message " Data may exist...... ?

Regards Kjeldc

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,119
Default msgbox

You need to toggle the display alerts setting...
Application.DisplayAlerts = False
Application.DisplayAlerts = True
As with any application level setting you are best off to use an error
handler something like this (in case your code crashes you need to reset the
application)

sub Stuff()
On error goto ErrorHandler
Application.DisplayAlerts = False

Sheet1.Delete
ErrorHandler:
Application.DisplayAlerts = True
end sub

--
HTH...

Jim Thomlinson


"Kjeldc" wrote:

I want to delete a worksheet, every time I open a workbook, but how can I
stop the msgbox from popping up with the message " Data may exist...... ?

Regards Kjeldc

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
msgbox muddan madhu Excel Worksheet Functions 2 April 14th 08 05:06 AM
msgbox Qaspec Excel Programming 2 February 4th 05 10:01 PM
If then MsgBox Todd Huttenstine[_3_] Excel Programming 2 November 26th 03 09:43 PM
msgbox Marcus Excel Programming 3 November 19th 03 11:35 PM
Msgbox Bernd[_2_] Excel Programming 0 October 24th 03 10:20 AM


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