Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
If Worbook Name = "X" then Prevent Macro From Running
Hi, I have a few macros that need to be run, but only after the user saves
the file as a different name. Any suggestions that would to add a VBA snippet to a macro that would prevent it to run if the current workbook name is "X"? If not too much additional trouble, could I add a pop-up box that states "Save File as Different Name Before Running Macro." ? Thanks very much... SteveC |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
If Worbook Name = "X" then Prevent Macro From Running
Hi Steve
Try this Sub test() If ThisWorkbook.Name < "X" Then ' your code Else MsgBox "Save File as Different Name Before Running Macro" End If End Sub -- Regards Ron de Bruin http://www.rondebruin.nl "SteveC" wrote in message ... Hi, I have a few macros that need to be run, but only after the user saves the file as a different name. Any suggestions that would to add a VBA snippet to a macro that would prevent it to run if the current workbook name is "X"? If not too much additional trouble, could I add a pop-up box that states "Save File as Different Name Before Running Macro." ? Thanks very much... SteveC |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
If Worbook Name = "X" then Prevent Macro From Running
Many thanks Ron. (Many of these macros already include snippets of code you
have posted. ) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
In Excel 2003 is there a way to prevent "Save As" and "Print"? | Excel Discussion (Misc queries) | |||
Sheets("Rpt").Copy different results from running in macro than off excel menu?? | Excel Discussion (Misc queries) | |||
Prevent code in "Sheet Activate" from running when sheet made visible from other macr | Excel Programming | |||
prevent recalculation of random data except in a "Calculate" macro | Excel Programming | |||
"Programmatic Access to be Denied" displays when running macro on excel in XP | Excel Programming |