Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
DisplayAlerts and ScreenUpdate will not set to False | New Users to Excel | |||
DisplayAlerts = False fails | Excel Programming | |||
Can't Set DisplayAlerts to False | Excel Programming | |||
Can't Set DisplayAlerts to False | Excel Programming | |||
Can't Set DisplayAlerts to False | Excel Programming |