F5 versus Form Control weirdness

Matt_O

Board Regular
Joined
May 23, 2013
Messages
64
Happy Holidays Excel Experts!

I am curious to know if anyone has thoughts on the following issue I'm encountering.

I have 4 modules that each run a separate routine. The first module is the master. It calls the second module which in turns calls the third which calls the fourth and final routine- like dominoes.

My issue is that I've assigned a form button to launch the master module and the outcome is unexpected- it appears as though the 4th module doesn't get called. Yet, when I click inside the master module in the developer window and press F5 the subs all run as intended.

I added a 5th module which just creates a message box to confirm it got triggered and call it from the end of the 4th module. Both the form button and pressing F5 result in seeing the message.

However, it appears as though I'm getting 2 different results from the same code which is driving me bonkers.

I've added new form buttons an assigned them to the master module to see if that would help and it didn't. I am using a form button to run the 4th module and it works as intended.

I understand that not seeing code isn't helpful but in this instance I know the code works when triggered by F5 but not with a form control. I've never encountered anything like this before. Any ideas?

Cheers,
Matt
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
.
I understand that not seeing code isn't helpful

Otherwise it's like the blind leading the blind. :eek:

Identical to me saying to you ... my car won't start. Whats wrong with it ?
 
Upvote 0
Hi Logit,

I think my earlier reply didn't get published due to a time out. Anyway...

Thanks for not calling me a complete moron which I completely deserve :biggrin:. And apologies for such a late reply. I didn't have access to my computer over the holidays.

In my first, failed reply I mentioned how difficult I found it trying to figure out to post the 4 separate modules and the corresponding data in a way that made sense. And basically left it at that and went back to work trying to solve my riddle. Which I did!

It turned out that I had omitted a sheet name when referencing specific cells. My master button is on the cover sheet and a particular module referenced cells on the active sheet which were empty. When I stepped through the code I was observing on a different worksheet where the code used the corresponding cells and all was good.

I bet you would have noticed the missing sheet reference in an instance!

Matt
 
Upvote 0
.
I bet you would have noticed the missing sheet reference in an instance!

I'll bet not. These eyes are getting older every day. Sometimes I miss alot and I have to remind myself to keep re-reading the lines of code to be certain I haven't missed anything. :eek:

In any case, if you have resolved your issue/s that is great ! Please mark the thread as SOLVED. Go to THREAD TOOLS upper right.


If you still need assistance please provide your code or better yet, post your workbook on a cloud site like DROPBOX, GOOGLE, AMAZON CLOUD, etc. (without any confidential data) so we can
take a look for you.


ps: If the sheet name was the error don't be bothered by it. It's always the 'obvious' or 'simple' things that usually get ya. :oops:

CHEERS !
 
Upvote 0
So the learning from this is to get in the habit of being explicit (or at least more careful) with all object references.

This sort of thing used to catch me occasionally but not to much in recent years. A good reminder, thank you.
 
Upvote 0
Thanks Logit and Fazza.
@Logit- I only seem to have 3 options in Thread Tools.
Show Printable Version
Email this Page
Unsubscribe from this Thread

Otherwise I would mark as resolved.

Matt
 
Last edited:
Upvote 0
Matt_O, I think Logit thought he was on another forum. You don't mark as solved on this forum (you have done all you need to by saying thank you but you could click the like or thanks button at the bottom of a post if you want).
 
Upvote 0
.
MARK858


You right !


Sometimes I walk into the next room and wonder where I am at !

:oops:

(and I thought things would be different in a new year ... )
 
Last edited:
Upvote 0

Forum statistics

Threads
1,215,852
Messages
6,127,324
Members
449,374
Latest member
analystvar

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