Stepping thru code

Giordano Bruno

Well-known Member
Joined
Jan 7, 2007
Messages
1,352
I have a workbook which contains the Function IsEmailValid(strEmail) It does its job perfectly well, but when I step though other code modules and change the worksheets in any way, this function suddenly gets called and I have to step through it to resume where the code suddenly jumped out. I have code that activates on workbook changes, but this is never called so this is not the cause. It happens intermittently, but quite frequently. It never happens when I run the code normally and none of my other functions ever gets these phantom calls. If anyone has any suggestions, I'd be most grateful.
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Do you know if any of the cells on the worksheet call this function? Would that cell call get triggered if the worksheet changes due to automatic calculation?
 
Upvote 0
Hi shknbk2. Thanks for the reply. The code is normally called only when a button is clicked to send the file as an email attachment. One of the checks this code makes is to call the function to determine whether the cell with the email address looks like a real address. This is the only path that leads to this function and no other code refers to this cell.
 
Upvote 0
Does anything change for the better if you make the function Private?
 
Upvote 0
I have a workbook which contains the Function IsEmailValid(strEmail) It does its job perfectly well, but when I step though other code modules and change the worksheets in any way, this function suddenly gets called and I have to step through it to resume where the code suddenly jumped out. I have code that activates on workbook changes, but this is never called so this is not the cause. It happens intermittently, but quite frequently. It never happens when I run the code normally and none of my other functions ever gets these phantom calls. If anyone has any suggestions, I'd be most grateful.
Don't know that you can avoid that, but you don't have to step through the function that's called inadvertently. Instead, hold down ctrl and shift keys and hit F8 to get back to the code of interest where the jump occurred.
 
Upvote 0
Hi shknbk2, I'll give it a try. Anything to stop this annoying behaviour.
Thanks for your interest JoeMO. I didn't know about that trick; sounds very useful. By the way, do you know if this is a VBA bug or have I been singled out for special treatment?
 
Upvote 0
Thanks for your interest JoeMO. I didn't know about that trick; sounds very useful. By the way, do you know if this is a VBA bug or have I been singled out for special treatment?
Don't know if its a bug, but I experience it frequently.
 
Upvote 0
Hi shknbk2. Your suggestion was worth a try, but I can now say that it definitely does not work. Pity!
Hi JoeMo. If it affects two people it's either a "feature" or a "bug". Since it has only nuisance value I think you can rule out that it's a feature.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top