Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the VBA IDE's Intellisense in Microsoft Word 2007 keep on changing the case of the name of a particular variable type?

Tags:

ms-office

vba

This is the most bizarre question I've ever asked. I'm not even sure how to phrase it. I remember something like this happening way back in the VB6 IDE, but I've forgotten the fix. If this is the case, then this is a really old bug in the VB IDE.

Here's the problem:

I'm writing a simple MS Word macro when I accidently typed:

Dim cell as Cell

This activated the dreaded IDE bug. Now, no matter what I do; remove the module, edit it outside the IDE or whatever, the IDE's intellisense formats the variable type "Cell" as "cell"

If I name a new variable:

Dim tcell as Cell

The IDE changes it to:

Dim tcell As cell

This infuriates me to no end. I've tried everything to no avail. This happens even if I edit the module file (.bas) outside of the IDE and reimport it back.

How can I stop this madness?

Updated

Apparently this behavior is not a bug, but by design. See answer.

like image 313
GeneQ Avatar asked Jun 02 '11 08:06

GeneQ


1 Answers

Try putting a

Dim Cell as Cell

somewhere, then delete it and try again... I seem to recall that variable declarations take precedence in setting the casing, thus this should force the casing back to how it should be...

like image 174
Simon Cowen Avatar answered Oct 06 '22 07:10

Simon Cowen