Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default VBA Stops Working?

Hello:

Excel 2003. I've noticed with some of my workbooks, particularly if I've
been working with them for a while, sometimes the code in the workbook will
not execute. For example, If I have a button or cell-change macro
programmed, sometimes the code will not execute if I click the button or
change the cell.

When I close Excel and re-open the workbook, it works fine.

Has anyone else noticed this? (Maybe you can point me to a knowledge base
article or something. I didn't see one.)

Thanks in advance,
MARTY
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,071
Default VBA Stops Working?

One possibility is that some code executes a
Application.EnableEvents=False but not the complementary =True.

Does your code start working if you switch to the VBE, open the
Immediate Pane (CTRL g), type Application.EnableEvents=True and press
ENTER?

Of course, in the Immediate pane you could also check the setting of
EnableEvents with ?Application.EnableEvents

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Hello:

Excel 2003. I've noticed with some of my workbooks, particularly if I've
been working with them for a while, sometimes the code in the workbook will
not execute. For example, If I have a button or cell-change macro
programmed, sometimes the code will not execute if I click the button or
change the cell.

When I close Excel and re-open the workbook, it works fine.

Has anyone else noticed this? (Maybe you can point me to a knowledge base
article or something. I didn't see one.)

Thanks in advance,
MARTY

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 983
Default VBA Stops Working?

As a guess are you turning events on and off in your code. If for some reason
there is a leak some where you may be turning events off without turning them
back on again. To check this next time it happens manually run this code to
see if the problem is fixed.

public sub ResetEvents
application.enableevents = true
end sub

That's my best guess.
HTH

"Marty" wrote:

Hello:

Excel 2003. I've noticed with some of my workbooks, particularly if I've
been working with them for a while, sometimes the code in the workbook will
not execute. For example, If I have a button or cell-change macro
programmed, sometimes the code will not execute if I click the button or
change the cell.

When I close Excel and re-open the workbook, it works fine.

Has anyone else noticed this? (Maybe you can point me to a knowledge base
article or something. I didn't see one.)

Thanks in advance,
MARTY

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default VBA Stops Working?

Thanks Jim.

If I'm turning events on and off I'm not doing it intentionally. I have no
..EnableEvents code in my procedures. Nevertheless, thanks for the
suggestion. I'll try it.

I'm still puzzled as to why it's happening though.

"Jim Thomlinson" wrote:

As a guess are you turning events on and off in your code. If for some reason
there is a leak some where you may be turning events off without turning them
back on again. To check this next time it happens manually run this code to
see if the problem is fixed.

public sub ResetEvents
application.enableevents = true
end sub

That's my best guess.
HTH

"Marty" wrote:

Hello:

Excel 2003. I've noticed with some of my workbooks, particularly if I've
been working with them for a while, sometimes the code in the workbook will
not execute. For example, If I have a button or cell-change macro
programmed, sometimes the code will not execute if I click the button or
change the cell.

When I close Excel and re-open the workbook, it works fine.

Has anyone else noticed this? (Maybe you can point me to a knowledge base
article or something. I didn't see one.)

Thanks in advance,
MARTY

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 116
Default VBA Stops Working?

Hi, Tushar:

Thanks for the response. See my response to Jim Thomlinson in this thread.
You and he had the same thought on this matter.

"Tushar Mehta" wrote:

One possibility is that some code executes a
Application.EnableEvents=False but not the complementary =True.

Does your code start working if you switch to the VBE, open the
Immediate Pane (CTRL g), type Application.EnableEvents=True and press
ENTER?

Of course, in the Immediate pane you could also check the setting of
EnableEvents with ?Application.EnableEvents

--
Regards,

Tushar Mehta
www.tushar-mehta.com
Excel, PowerPoint, and VBA add-ins, tutorials
Custom MS Office productivity solutions

In article ,
says...
Hello:

Excel 2003. I've noticed with some of my workbooks, particularly if I've
been working with them for a while, sometimes the code in the workbook will
not execute. For example, If I have a button or cell-change macro
programmed, sometimes the code will not execute if I click the button or
change the cell.

When I close Excel and re-open the workbook, it works fine.

Has anyone else noticed this? (Maybe you can point me to a knowledge base
article or something. I didn't see one.)

Thanks in advance,
MARTY


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
IF just STOPS WORKING Gee Excel Worksheet Functions 21 August 6th 09 05:26 PM
Vlookup stops working??? Steve Peel Excel Worksheet Functions 0 September 19th 08 07:08 PM
VLOOKUP stops working at row 13 Ann Scharpf Excel Worksheet Functions 4 August 23rd 07 03:45 PM
Autofilter Stops Working Vliegveld Excel Worksheet Functions 7 September 7th 05 01:19 AM
Worksheet_SelectionChange stops working jlr_nz Excel Programming 2 November 8th 03 09:08 PM


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