Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent - VBA Code Not Running
Hello All,
Newbie question. I wrote some code for a workbook and specifically I use the events of the worksheet (I have 4 sheets) to catch the Selectionchange and change. The first time the code was running fine but when I closed and reopened the file the code did not run again. What's going on? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent - VBA Code Not Running
Can you post the code?
x-rays wrote: Hello All, Newbie question. I wrote some code for a workbook and specifically I use the events of the worksheet (I have 4 sheets) to catch the Selectionchange and change. The first time the code was running fine but when I closed and reopened the file the code did not run again. What's going on? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent - VBA Code Not Running
Usually that happens when the Application.EnableEvents is turned off.
To check just go to the immediate window and type ? Application.EnableEvents "x-rays" wrote: Hello All, Newbie question. I wrote some code for a workbook and specifically I use the events of the worksheet (I have 4 sheets) to catch the Selectionchange and change. The first time the code was running fine but when I closed and reopened the file the code did not run again. What's going on? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent - VBA Code Not Running
I guess it would on your code.
NickHK "x-rays" groups.com... Hello All, Newbie question. I wrote some code for a workbook and specifically I use the events of the worksheet (I have 4 sheets) to catch the Selectionchange and change. The first time the code was running fine but when I closed and reopened the file the code did not run again. What's going on? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent - VBA Code Not Running
Hard to say from your limited description but my best guess would be that
your code probably toggles Application.EnableEvents on and off. If your code turns events off and does not turn them back on again then No events will be firing. Try running this little procedure and see if it helps Sub ReEnable() Application.EnableEvents = True end sub If that fixes your problems then you need to find out why your events were turned off without being turned on again. If you need help with that just reply back... -- HTH... Jim Thomlinson "x-rays" wrote: Hello All, Newbie question. I wrote some code for a workbook and specifically I use the events of the worksheet (I have 4 sheets) to catch the Selectionchange and change. The first time the code was running fine but when I closed and reopened the file the code did not run again. What's going on? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent - VBA Code Not Running
Now says that I have to enable the macros and refer to online help
Jim Thomlinson wrote: Hard to say from your limited description but my best guess would be that your code probably toggles Application.EnableEvents on and off. If your code turns events off and does not turn them back on again then No events will be firing. Try running this little procedure and see if it helps Sub ReEnable() Application.EnableEvents = True end sub If that fixes your problems then you need to find out why your events were turned off without being turned on again. If you need help with that just reply back... -- HTH... Jim Thomlinson "x-rays" wrote: Hello All, Newbie question. I wrote some code for a workbook and specifically I use the events of the worksheet (I have 4 sheets) to catch the Selectionchange and change. The first time the code was running fine but when I closed and reopened the file the code did not run again. What's going on? |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Urgent - VBA Code Not Running
Ok guys it works with the Application.EnableEvents = True
I had first to close and reopen the file. Thank you all very very much! Have a nice day (or night)! x-rays wrote: Now says that I have to enable the macros and refer to online help Jim Thomlinson wrote: Hard to say from your limited description but my best guess would be that your code probably toggles Application.EnableEvents on and off. If your code turns events off and does not turn them back on again then No events will be firing. Try running this little procedure and see if it helps Sub ReEnable() Application.EnableEvents = True end sub If that fixes your problems then you need to find out why your events were turned off without being turned on again. If you need help with that just reply back... -- HTH... Jim Thomlinson "x-rays" wrote: Hello All, Newbie question. I wrote some code for a workbook and specifically I use the events of the worksheet (I have 4 sheets) to catch the Selectionchange and change. The first time the code was running fine but when I closed and reopened the file the code did not run again. What's going on? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to prevent code running when in a worksheet code | Excel Programming | |||
Very urgent help needed: Excel is still running after closing it! | Excel Programming | |||
Urgent Help needed - I need to stop a process that is running forever in Excel | Excel Discussion (Misc queries) | |||
Automatic running Plug-in functions on load -- Urgent | Excel Programming | |||
urgent vba code wanted | Excel Programming |