Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Where to put DisplayAlerts = False

Hi,
I have tried inserting DisplayAlerts = False all over the following
block of code , but when I go to delete the sheets, it still asks if I
want to delete them. Is this not the right syntax or am I doing
something wrong?
Thanks,
Joe Fish

Sub SetUpScrollerInfo()

DisplayAlerts = False
Run ("DeleteOldSheets")
Run ("MakeNewSheets")
Run ("ImportData")
Run ("FormatData")
Run ("AddToPositionAndUnitNumberFormula")
Run ("DefineBundles")
Sheets("Scroller Info").Range("A1").Select

End Sub
Sub DeleteOldSheets()

DisplayAlerts = False
Sheets("Scroller Info").Delete
DisplayAlerts = False
Sheets("Spare Scroller Cables").Delete

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Where to put DisplayAlerts = False

You need to qualify 'DisplayAlerts' with 'Application'. E.g,

Application.DisplayAlerts = False

Without the Application qualification, VBA treats 'DisplayAlerts'
as a variable name, creates the variable, and assigns it a value
of False. This would be obvious if you properly placed 'Option
Explicit' at the top of your code module.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"Joe Fish" wrote in message
oups.com...
Hi,
I have tried inserting DisplayAlerts = False all over the
following
block of code , but when I go to delete the sheets, it still
asks if I
want to delete them. Is this not the right syntax or am I doing
something wrong?
Thanks,
Joe Fish

Sub SetUpScrollerInfo()

DisplayAlerts = False
Run ("DeleteOldSheets")
Run ("MakeNewSheets")
Run ("ImportData")
Run ("FormatData")
Run ("AddToPositionAndUnitNumberFormula")
Run ("DefineBundles")
Sheets("Scroller Info").Range("A1").Select

End Sub
Sub DeleteOldSheets()

DisplayAlerts = False
Sheets("Scroller Info").Delete
DisplayAlerts = False
Sheets("Spare Scroller Cables").Delete



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 430
Default Where to put DisplayAlerts = False

change to:
Application.DisplayAlerts = False
Your code....
Application.DisplayAlerts = True

"Joe Fish" wrote in message
oups.com...
Hi,
I have tried inserting DisplayAlerts = False all over the following
block of code , but when I go to delete the sheets, it still asks if I
want to delete them. Is this not the right syntax or am I doing
something wrong?
Thanks,
Joe Fish

Sub SetUpScrollerInfo()

DisplayAlerts = False
Run ("DeleteOldSheets")
Run ("MakeNewSheets")
Run ("ImportData")
Run ("FormatData")
Run ("AddToPositionAndUnitNumberFormula")
Run ("DefineBundles")
Sheets("Scroller Info").Range("A1").Select

End Sub
Sub DeleteOldSheets()

DisplayAlerts = False
Sheets("Scroller Info").Delete
DisplayAlerts = False
Sheets("Spare Scroller Cables").Delete



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
DisplayAlerts and ScreenUpdate will not set to False Joe at Baso New Users to Excel 1 April 5th 05 07:41 PM
DisplayAlerts = False fails Jerry Excel Programming 1 December 15th 04 09:09 AM
Can't Set DisplayAlerts to False Mark Driscol Excel Programming 0 April 7th 04 06:11 PM
Can't Set DisplayAlerts to False Mark Driscol Excel Programming 1 April 6th 04 10:45 PM
Can't Set DisplayAlerts to False Mark Driscol Excel Programming 2 April 2nd 04 12:28 PM


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