loop not looping
-
- Panoramic Lounger
- Posts: 8191
- Joined: 25 Jan 2010, 09:09
- Location: retirement
loop not looping
I have code that I know works as expected. It lives in a global template and users run it by clicking a custom button in a custom section of the Home tab on the Ribbon. At least nine users use this feature regularly without any problems. On those machines the code runs and as expected, i.e. it ends by asking you if you want to start again or if you want to stop.
You can here the BUT coming, can't you?
BUT it does not do that on one user's machine. On that machine the code runs and just stops. There are no error messages and it does not ask the rerun/stop? question.
I have checked numerous settings in Office and, as far a I can see, this problem machine is setup in exactly the same way as all our other machines. Does anybody have any suggestions as to what this user might have done/tweaked within Word / Word's VBE to make the code not run properly?
Thanks,
Ken
You can here the BUT coming, can't you?
BUT it does not do that on one user's machine. On that machine the code runs and just stops. There are no error messages and it does not ask the rerun/stop? question.
I have checked numerous settings in Office and, as far a I can see, this problem machine is setup in exactly the same way as all our other machines. Does anybody have any suggestions as to what this user might have done/tweaked within Word / Word's VBE to make the code not run properly?
Thanks,
Ken
-
- Administrator
- Posts: 12629
- Joined: 16 Jan 2010, 15:49
- Location: London, Europe
Re: loop not looping
It's hard to guess without seeing the code. Did you try single stepping it to see what happens?
StuartR
-
- Panoramic Lounger
- Posts: 8191
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: loop not looping
The code runs correctly on every other machine and because it's in a global template users cannot even view the code so I don't think the code is the problem. However, users can open the VBE and the owner of the problem machine is the only person in the team (other than me) not to be afraid of opening the VBE. That's why I'm wondering if the user has changed something. The user is not owning up to making any changes...
Ken
Ken
-
- PlutoniumLounger
- Posts: 15651
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: loop not looping
Hi Ken; stories like this make me glad that I am retired!
By "... user has changed something ..." I take it that you mean that the user has not changed anything in your template, but might have changed something in some other template?
A simple example: If you were using that one-off On Time construct in your Word template, everything would be fine, but if a rogue user ("ChrisGreaves") wrote his/her own VBA code and used On Time, then there would be a conflict.
Is that the type of scenario?
A different test would be for you to password-protect/lock the global template and re-release it and see if the problem remains (confirmation that the rogue user's environment was different).
The Chris Greaves of this world, once they open the Pandora's Box, are a force to be reckoned with.
On a basic level, is it possible to put a break-point in the form of a Stop statement just before each critical point? Or else log (to a text file) the passage of control through those vital bits of code?There are no error messages and it does not ask the rerun/stop? question.
We can leave the question of "What else in your code is being bypassed" besides the obvious user-messages, to another date.(1)
(1)If your colleague works in a financial department, you might casually ask for bank-produced printouts of personal bank statements
Cheers
Chris
He who plants a seed, plants life.
-
- Panoramic Lounger
- Posts: 8191
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: loop not looping
Hi Chris,
Thanks, things to think about in there. I'll give a full answer later but that might not be until Monday now.
Ken
Thanks, things to think about in there. I'll give a full answer later but that might not be until Monday now.
Ken
-
- Microsoft MVP
- Posts: 1320
- Joined: 24 May 2013, 15:33
- Location: Warminster, PA
Re: loop not looping
Another path to examine: Is there any possible interaction between the code and the content of the active document that could cause a stop? Investigate whether the document contains some character(s), especially the nonprinting ones that are visible only when you turn on the ¶ button, that could be "fatal" data for the macro.
-
- 5StarLounger
- Posts: 1106
- Joined: 21 Jan 2011, 16:51
- Location: Florida
Re: loop not looping
Any references set or required that are not set, or is there a code dependence on early vs late binding?
PJ in (usually sunny) FL
-
- 5StarLounger
- Posts: 721
- Joined: 21 Aug 2011, 21:01
- Location: The beautiful hills of Western North Carolina
Re: loop not looping
Ken, your description of the issue implies that the routine in question has successfully run on The Tenth Machine ("TTM") in the past and has only stopped working recently. Is that true?
Is the global template on a network drive or has it been downloaded to each machine?
Have you checked to make sure there are no temp files lurking about on TTM? Temp files can flummox Word in peculiar ways. If the machine crashed, temp files of any global templates might be lingering and interfering.
Kim
Is the global template on a network drive or has it been downloaded to each machine?
Have you checked to make sure there are no temp files lurking about on TTM? Temp files can flummox Word in peculiar ways. If the machine crashed, temp files of any global templates might be lingering and interfering.
Kim
"Hmm. What does this button do?" Said everyone before being ejected from a car, blown up, or deleting all the data from the mainframe.
-
- Panoramic Lounger
- Posts: 8191
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: loop not looping
Thank you everybody!
or has it been downloaded to each machine?
I've not forgotten Chris's ideas either. I'm hoping to have another poke at this problem later today. I'll report back in due course.
Ken
That's an easy one. The same document + macro combination works as expected on everybody's machine except this one, i.e. document content is not the problem.Jay Freedman wrote: ↑04 Dec 2020, 22:03...Investigate whether the document contains some character(s)...
The problem machine has the same references set as the all the OK ones. As for early / late binding. My code is ugly, it is not optimal by any stretch of the imagination but it works on all the other machines.
Yes, which is why I think the root of this problem is something that the user has done to the machine (but they are not admitting to anything).
Yes, and all the OK machines access it and run it correctly. The problem machine must also be able to access it, otherwise it wouldn't even partially run. it
or has it been downloaded to each machine?
I've not looked for lurking temp files but I will now.
I've not forgotten Chris's ideas either. I'm hoping to have another poke at this problem later today. I'll report back in due course.
Ken
-
- PlutoniumLounger
- Posts: 15651
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: loop not looping
Hello Ken.
Your first big mistake was leaving This Giant Brain all weekend to come up with yet-another-idea.
Set up a an eleventh machine equipped to run your template; test it out in the secrecy of your own plain brown-paper envelope, and then while your colleague is out having elevenses, swap the two machines.
In theory the eleventh machine is a stripped-down version of your colleague's machine; it merely lacks the statistics file on Solitaire and other non-standard stuff.
If the 11th machine does NOT work, then the problem is probably somewhere along the network pipeline?
If the 11th machine DOES work, then measure the possibility of pre-loading it with colleagues essential software and repeating the test.
If the 11th machine does NOT work, then the problem is probably somewhere in the essential other-software.
If the 11th machine DOES work, then the problem is probably somewhere in the non-essential other-software OR something to do with a Windows table or file overflowing/corruption?
I recognize that this is just a top-down binary-chop approach, and I am sure that by now you have a piece of paper (with the equivalent felt-pen diagrams scrawled on it) pinned to the wall of your cubicle ...
P.S. In lieu of an eleventh machine you could try just swapping (as in physically lugging) colleague's machine with some other machine, basically un-plug and re-plug, as we used to do back in the day when we had real micro-computers at each desk.
Cheers
Chris
He who plants a seed, plants life.
-
- Panoramic Lounger
- Posts: 8191
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: loop not looping
The difficulty with swapping machines around is that we are not in the same office, we're not even in the same building. We are all working from our own homes, across the company's VPN.
And before any one says, "Oh, why didn't you mention that extra bit of complexity earlier?", I refer you to my previous statement that it's only this one machine that's not behaving as it should. Despite the variety of Internet connections we are working across, it woks for all except one.
Ken
And before any one says, "Oh, why didn't you mention that extra bit of complexity earlier?", I refer you to my previous statement that it's only this one machine that's not behaving as it should. Despite the variety of Internet connections we are working across, it woks for all except one.
Ken
-
- PlutoniumLounger
- Posts: 15651
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: loop not looping
Fair enough.
(falls back to distant defence line and re-strings his bow)
One last try: If the company is so rich then the next time they buy a computer, kit it out with the corporate software, test it, and ship it to the colleague.
Make them test your template before they make any changes.
If they then load the fascinating war-game "sex goddess of the midnight vampires" and subsequently complain that your template is failing, you at least have an idea.
I did a contract for a large pharmaceutical that, when I re-booted the computer each morning (this was an Excel VBA project after all!), the old machine reloaded the C: image across the LAN. I timed it the first few times - 45 minutes to reboot. (Well, 43 minutes to LAN-copy the image and two minutes to boot, but you get the idea).
Another fall-back: something else stops working, and only on this machine.
Another fall-back: "everybody's" machine has to be submitted for a refreshed system image, starting with your colleague's machine.
These and other similar suggestions seem to be expensive to the bean-counters, but compared to the cost of having you spend hours trying to find out, the cost is trivial.
And yes, it is very easy for me, "Retired old guy of Bonavista" to spend other people's money.
I love this thread; it's like one of those ten-minute serials they used to show Friday nights before the main picture.
Cheers
Chris
He who plants a seed, plants life.
-
- GoldLounger
- Posts: 2599
- Joined: 24 Jan 2010, 15:26
- Location: Olympia, WA
Re: loop not looping
Are the users using company provided machines or are using their own?We are all working from our own homes, across the company's VPN.
If not company owned machines, what versions of the OS and Office compared to the versions of the working machines?
What AV and other protection programs are running on this machine?
I am so far behind, I think I am First
Genealogy....confusing the dead and annoying the living
Genealogy....confusing the dead and annoying the living
-
- Panoramic Lounger
- Posts: 8191
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: loop not looping
Everybody is using the same company provided hardware (Dell Latitude laptop) with the same company-wide OS and application image, a common OS, AV and Office apps365. They all update regularly via WSUS. Plus all out team have a common set of tweaks applied to their Office profile, to ensure they default to our templates. This again is why I suspect the problem is a user initiated change to something within Office / Office VBE on the problem machine.
Ken
-
- GoldLounger
- Posts: 2599
- Joined: 24 Jan 2010, 15:26
- Location: Olympia, WA
Re: loop not looping
Then I would say that it is time to have a house call and visit this machine on site!
I am so far behind, I think I am First
Genealogy....confusing the dead and annoying the living
Genealogy....confusing the dead and annoying the living
-
- PlutoniumLounger
- Posts: 15651
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: loop not looping
When I was in business I made use of, and asked clients to install, a tiny-footprint program that let us operate each others computers.
I forget the name and seem to have wiped it off my machine.
I recall that it was dead-simple to use. My client could d/l and install it in about 60 seconds, then, somehow, my client and I hooked up (with a key word, I think), and voila! I could operate my client's Windows system as if I were sitting deskside (and vice-versa, if I recall correctly).
Someone here still uses it, I bet, and at the mention of the name I shall shriek "that's it".
That was a time saver deluxe for us, because I could tweak, or demonstrate, some feature in ten minutes, for a client in another city.
I know this is vague, but Ken, is that not a possibility, for you to single-step through the code remotely?
Cheers
Chris
He who plants a seed, plants life.
-
- Administrator
- Posts: 7218
- Joined: 15 Jan 2010, 22:52
- Location: Middle of England
Re: loop not looping
Ummm, Dave... We have something called Covid-19 doing the rounds in this country. This may be why some folk are working from home...
Leif
-
- GoldLounger
- Posts: 2599
- Joined: 24 Jan 2010, 15:26
- Location: Olympia, WA
Re: loop not looping
Well we do to, but some things just need to be addressed.
Service calls and deliveries are made every day.
Service calls and deliveries are made every day.
I am so far behind, I think I am First
Genealogy....confusing the dead and annoying the living
Genealogy....confusing the dead and annoying the living
-
- Panoramic Lounger
- Posts: 8191
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: loop not looping
I am not allowed to make a house call. Strictly speaking I'm not even allowed to walk to the pub on the road out of the village but that's a far to political story for this forum
Ken
-
- Panoramic Lounger
- Posts: 8191
- Joined: 25 Jan 2010, 09:09
- Location: retirement
Re: loop not looping
That approach is on the 'to do' list. MS Teams allows me to both see and control a remote PC. Seeing Is OK but controlling is a bit like stirring concrete.ChrisGreaves wrote: ↑08 Dec 2020, 16:45...a possibility, for you to single-step through the code remotely?...
Ken