Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Case Changing

Status
Not open for further replies.

jaggiebunnet

Programmer
Jun 10, 2004
95
EU
hi all

I am trying to write some vba for a 3rd party application - the vba is not too bad but something has happened where one of my objects I reference, say Object B has a parameter say Value and when I type in

B.Value

vba changes it to

B.value and my code doesnt work

anyone have any ideaswhat I did to screw this up and how i should fix it?

Thanks.
R.
 
Double check the references.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
It is sometimes a bit of a mystery but it doesn't matter.

The case change will not affect how your code runs. Something else must be wrong.

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 




Is B really an object? How are you assigning B?

Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
hi thanks for the reply, I have checked them and removed and replaced the library it was referencing to make sure it was picked up ok but there is no change. The library the object is in is at the top of the non - required list and all the other object properties are capitalised correctly. This was working earlier this morning, until I typed something or hit some key and I was not able to undo it.

Any other suggestions?
 
Any other suggestions
Yes: post your code ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Yes it is really an object - it belongs to the 3rd party library. I guess I am just trying to work out why it feels the need to change the case. The object is

Designer and I am trying to instantiate one of its properties:

dim myContext as Designer.Context

instead when I press return I get

Designer.context

Now I know that I have not changed that library as it is, as I have said 3rd Party. And when I list the object's properties it is in the proper case. Not being a vb programmer for a long time I am not sure why this would happen though I do have a faint memory tickle from college that if you create a variable in your code it could update previous variable types or something - as in the case? But as I have removed all versions of context from my code to test if that would fix it and it didn't I guess I am wrong.

Cheers guys.
R.
 
VBA decides on casing, generally, based on latest usage. Normally if you have:
Code:
B.value
you can change it by coding
Code:
Dim Value
B.value
If you then delete the Dim, the (changed) capitalisation will remain.

This is not guaranteed - and it does not affect how your code runs.

What is your actual problem as opposed to your idea as to what caused it?

Enjoy,
Tony

------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.

I'm working (slowly) on my own website
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top