• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Need help diagnosing strange behavior with strings containing "AJ"

BobBridges

Active Member
I've just encountered something strange in Excel VBA. I gotta think it's related to the latest update, but I've been wrong so many times before.

Usually in the VBE I can mouse over a variable to see its value, for example I might see this popup:
Code:
va = "AJONES BBRIDGES HTHOMAS"
This error, however, causes the popup to drop the last word and the final quote, like this:
Code:
va = "AJONES BBRIDGES
If there's only one word in the string—for instance if va contains only "AJONES"—the mouseover shows this:
Code:
va =
Again notice the missing quotes. Has anyone else spotted this?

The trigger, after much experimentation, seems to be, simply, the appearance of the letters "AJ" anywhere in the string. They must be upper case, and they must be adjacent, and they must be in that order.

It gets weirder: 1) I wondered whether one of the spaces might really be a CR or LF, but I typed the string manually into the program and it still errs. 2) The string is displayed properly in the Immediate window; when I ask "?va" I see nothing wrong there. 2) Len(va) correctly tells me the length of the string, both in the code and the Immediate window.

But wait, there's more! I split the string; in the Immediate window all the values in the array display correctly, but a mouseover of each element in the code window shows the same error for the particular word that contains "AJ"; the other words show correctly. I assign each element of the array to a collection; the whole collection is displayed correctly in the Immediate window, but mousing over any of the items in the code window show the same problem.

I shut down Excel and started it up again. I rebooted my PC. I tested it in two copies of Excel (one on a remote desktop for my client in Michigan—I think they use Office 365—and the other on my own Office Pro Plus 2019 here at home). Can anyone tell me what, if anything, I'm doing wrong? Also if it's Excel, a nice workaround would be convenient. At this point I'm thinking I'll just have to put a statement in my program to check for "AJ" and stop if it's found.
 
What about "AJ" showing "OJ" and creating a link for ESPN ?

Sorry .... it was too tempting. Best wishes in your search.
 
As I can't reproduce such issue under Excel 2010 …​
If there is some add-in then try to desactivate it.​
 
I can reproduce in 365 64bit. Very odd. Not really sure why you need a workaround when it's only the tooltip that is affected?
 
I was debugging a problem when I encountered this issue, and assumed that the issue was the cause of the problem. It was only after I'd experimented extensively, and reported it here, that I went back to see what exact effect it would have on the way my program ran ... and realized that, as you said, it's only in the VBA display, not in the program results.

Still, very odd.
 
Bob, if you are under 365-64bit like Debaser check on some Microsoft website if this error is well known …​
 
...if you are under 365-64bit...
Pretty sure I'm using 365 on the Michigan machine. My own is doing it too, and that's definitely not 365.

In any case it's a weird error. I suppose there must be other character combinations that trigger it, not just "AJ", but I haven't found any yet. And five years ago, and it still isn't fixed? Weirder still.
 
The fact that it isn't fixed isn't weird at all. It's a very obscure bug with simple workarounds; add to that the fact that MS couldn't care less about VBA these days...
 
...MS couldn't care less about VBA these days...
I hear that complaint a lot—"<Company> doesn't care about <important product>"—and I figure it usually means "I'm not getting the level of support I need for it". I'm skeptical about MS not caring about VBA, unless you can convince me they don't care about Office either.

"Obscure bug with simple workarounds" is a better argument. Still, it's hard to believe that I wouldn't look for the cause in five years, if I were responsible for it.
 
Caring about VBA and caring about Office are not at all the same thing. MS doesn't care about VBA because it doesn't work online, and they want a seamless experience between desktop and cloud if possible, which is why Office Scripts came along. Their only investment in VBA has been what was required to keep enterprises buying Office (eg 64bit support, and adding in new worksheet functions). All you have to do is look at the VBE. If they saw a future for VBA, the editor would be upgraded. VBA gets slightly more attention than XLM but that's about it.
 
If MS does not cary anymore about VBA maybe it's 'cause MS seems to move to Python (should we called it VPA, LoL) …​
 
Back
Top