Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 129
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 318
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default 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
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
how to prevent code running when in a worksheet code Corey Excel Programming 5 August 13th 06 08:52 AM
Very urgent help needed: Excel is still running after closing it! hans[_5_] Excel Programming 2 February 3rd 06 01:04 PM
Urgent Help needed - I need to stop a process that is running forever in Excel shadestreet Excel Discussion (Misc queries) 2 October 6th 05 09:59 PM
Automatic running Plug-in functions on load -- Urgent kumar_8675[_2_] Excel Programming 0 October 26th 04 02:22 PM
urgent vba code wanted helmekki Excel Programming 2 May 12th 04 12:38 PM


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