PDA

View Full Version : [SOLVED:] How do you get Excel VBA to realize the default properties again



Daxton A.
03-20-2023, 11:44 AM
I was coding and used a module name of numberFormat() and realized that it was already a default property of excel. Now, I changed the name of my module but Excel still mirrors the nameż

I even searched the whole workbook using CTRL + F and didn't find any other name usage other than the default property names.

Now, i cannot get my actual .NumberFormat property to work.

Also, I cannot upload the spreadsheet because it is too big. Any clue?

Thanks,
Daxton

June7
03-20-2023, 12:19 PM
Is it an issue in a new workbook?

Daxton A.
03-20-2023, 01:06 PM
Well this maybe an issue with the RAM as well. That PC needs a replacement.

I was able to open one of my previous copies and just rewrite my module with a different name but that still doesn't increase my future endeavor knowledge of how to write "Microsoft's Default Code" back the way that it was. (Don't know the proper terminology)

June7
03-20-2023, 01:12 PM
If it is not an issue in other workbooks, possibly problem wb is corrupted.

I have never encountered this but then I never named a module same as intrinsic function or property.

Daxton A.
03-20-2023, 01:21 PM
Nope, it isn't a ram issue. I tried it on a new workbook on a different pc and it did the same thing.

Daxton A.
03-20-2023, 01:31 PM
Quite possibly, a new task for Bill Gate's to tackle. :think:

June7
03-20-2023, 01:55 PM
On another PC? Exactly what did you do in that new workbook? Did you do the same error?

What version of Excel?

Paul_Hossler
03-20-2023, 06:34 PM
One thing you can try

1. Export the numberFormat module
2. Remove it from the WB
3. Save WB
4. Close Excel

5. Use Notepad and edit numberFormat.bas

The first lines look like


Attribute VB_Name = "numberFormat"

Option Explicit


so change the VB_Name to "something" and save it as "something.bas"


6. Open Excel, open WB, import "something.bas"

Daxton A.
03-21-2023, 10:02 AM
Yes that worked for me Paul, thanks. So that tells me that as long as the Module is still in existence, then the system code is still funky. Thanks for the wisdom everyone!

Daxton Allen

Aflatoon
03-22-2023, 06:12 AM
You should also just be able to type something like:


Dim NumberFormat

and then delete it in order to reset the capitalisation (I assume that was the only issue).