I'm not much of a Visual Basic person, but I am tasked with maintaining an old VB6 app. Whenever I check out a file, the editor will replace a bunch of the uppercase variable names with lowercase automatically. How can I make this stop!? I don't want to have to change them all back, and it's a pain to have these changes show up in SourceSafe "Differences" when I'm trying to locate the REAL differences.
It is changing it automatically in the definition, too:
Dim C as Control
becomes Dim c as Control
. Dim X&
becomes Dim x&
. But it doesn't do it all the time; for example, three lines down from Dim x&
, there's a Dim Y&
, uppercase, which it did not change. Why's it do this to me?
Best Answer
Since I always find this thread first looking for a solution to messed-up casing, here is one Simon D proposed in a related question:
If you just need to fix one variable's casing (e.g. you accidentally made a
cOrrectCAse
variable and now they are all over the place), you can correct this for good by addingto the beginning of your module. If you save the project and remove the statement later, the casing remains correct.
Using Excel VBA I often accidentally change all
Range.Row
toRange.row
by carelessly dimming arow
variable inside some function - with the help of Simon D's solution I can fix this now.