SOLVED

Excel vba declared a variable using object

New Contributor

I stupidly decided to name a shape variable as so:

 

Dim shaPes as Shape

 

I have since removed the variable and all usage of it from the entire project. Even though I have, every time I want use "Sheet.Shapes" it changes automatically to "Sheet.shaPes". I wouldn't care but it causes the Shape object to fail of course.

 

Any help would be appreciated!

3 Replies

@Jeff43615 Did this behavior still occur after you removed the variable, closed Excel, and reopened the workbook?  If so, my suggestion is to use the VBE Tools | References dialog to note the relative location of "Microsoft Excel nn Objects Library", then (temporarily) place that reference at the top in priority.  Save, close, reopen, and check again.

best response confirmed by Jeff43615 (New Contributor)
Solution
Thank you for your answer. Unfortunately, I was not able to resolve the error using this method. After digging much deeper in Stack Overflow I was able to find a solution.

https://stackoverflow.com/questions/38640121/vba-object-properties-appear-in-lower-case

Of course I will be avoiding this in the future by staying away from reserved words.
Glad you found a solution, and thank you for posting the Stack Overflow link.