Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MWE MWE is offline
external usenet poster
 
Posts: 20
Default Worksheet_Change sub causes funny results

I am running Excel2000 under WinXP. I have an Excel
application with a fair amount of VBA code. I use the
worksheet sub "Worksheet_Change(ByVal Target As Range)" to
keep track of various things done for a given worksheet.
I have used this approach for several years running
Excel2000 on Win2k. I now notice something different. If
the macros are enabled and I delete a row or column in one
of the tabs with the Worksheet_Change sub and that sub
calls any other sub, Excel hangs. I can sweep huge cell
areas and things work OK, but if I select a single row or
column, Excel hangs. Resource use remains at a few
percent, other tasks run find (while Excel is hung), etc.
I can get Excel's attention by clicking on the upper right
hand corner X. If I cancel out of the resulting close
window, everything seems OK.

Any help would be appreciated.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Worksheet_Change sub causes funny results

Do it again and when it starts "hanging" hit Ctrl + Break and you'll be
taken to the VBA Editor with the line that was next up for execution
hilighted. This way you'll be able to see what it's doing for all that
time. If the answer is still unclear, post your new information here.
In the meantime, though since you're an old hand here you may have
thought of this already, I once used "Worksheet_Change" in such a way
that it updated the worksheet that started the process in the first
place, causing yet another call to that bit of code. The result, at
first, was a never ending loop that always resulted in it reactivating
itself, even if the values in the sheet didn't change visibly. - Pikus


---
Message posted from http://www.ExcelForum.com/

  #3   Report Post  
Posted to microsoft.public.excel.programming
MWE MWE is offline
external usenet poster
 
Posts: 20
Default Worksheet_Change sub causes funny results

none of the standard things that normally stop runaways,
e.g., Cntl+c, cntl+break, etc. work. I do not think that
this is a runaway. There is virtually no CPU usage and
every other application works fine. Rather Excel seems to
be waiting for something to happen. As best as I can
tell, all of the things that were supposed to be done when
Worksheet_Change was called did occur: I have a MsgBox
debug statement as the first executable statement in
Worksheet_Change and another as the last exeucable
statement before End Sub. Both display to the screen and
then Excel hangs. It seems that "control" does not pass
back to the user.
-----Original Message-----
Do it again and when it starts "hanging" hit Ctrl + Break

and you'll be
taken to the VBA Editor with the line that was next up

for execution
hilighted. This way you'll be able to see what it's

doing for all that
time. If the answer is still unclear, post your new

information here.
In the meantime, though since you're an old hand here you

may have
thought of this already, I once used "Worksheet_Change"

in such a way
that it updated the worksheet that started the process in

the first
place, causing yet another call to that bit of code. The

result, at
first, was a never ending loop that always resulted in it

reactivating
itself, even if the values in the sheet didn't change

visibly. - Pikus


---
Message posted from http://www.ExcelForum.com/

.

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 BE FUNNY!<%<%<%<% Expert Humor Charts and Charting in Excel 0 March 31st 06 07:11 AM
<%<%<%<%HOW TO BE FUNNY!<%<%<%<% Expert Humor Excel Worksheet Functions 0 March 31st 06 06:56 AM
<%<%<%<%HOW TO BE FUNNY!<%<%<%<% Expert Humor Excel Discussion (Misc queries) 0 March 31st 06 06:54 AM
worksheet_change vs. calculate, and worksheet_change not running Tom Ogilvy Excel Programming 1 July 14th 03 02:51 AM
worksheet_change vs. calculate, and worksheet_change not running Ross[_5_] Excel Programming 0 July 13th 03 04:27 PM


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