New version keeps calling up old version

Rufus Clupea

Board Regular
Joined
Feb 11, 2019
Messages
85
Hi folks,

OK, got myself in a jam again. :confused:

In a major re-building of my project (to make use of stuff I learned here :)), I did a lot of copy/pasting procedures from the old version to the new. Obviously I did something wrong, because the new version keeps calling up (or trying to call up—I changed the filename) the old version. Now I get an (understandable) error that Excel can't find the old version, but it won't execute without it.

How can I correct this, i.e is there some way to sever the connection between versions?

TIA
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
What are the symptoms, the errors, anything? Or is it just crying for its buddy gone missing :)
Is it only missing pieces of code or sheet formulas too?
As far as I know there is no link - unless there are formulas linked to external wb but you will get a message on the subject.

Did you do debug->compile? Do you use Option Explicit in your modules.
You are probably missing variables, functions or routines which you forgot to transfer to the new file, but your new code still calls them from time to time.

Use debug->Compile as many times as needed until no errors are left - try to sort each error.
If after this your code fails again:
Use Option Explicit as first line in all your modules. (this will raise an error every time you use a variable without declaring it first - tedious at first bur tremendously reduces the amount of silly hard to catch errors. Simply good practice)
Then again debug->Compile as many times as needed until no errors are left.
 

higrm

New Member
Joined
Nov 5, 2014
Messages
47
What about named ranges? Does your code have any references to named ranges. Those can have links to older versions.
 

Rufus Clupea

Board Regular
Joined
Feb 11, 2019
Messages
85
Use Option Explicit as first line in all your modules.
Thanks, I do. Keeps me diligent (as I can be at this level). ;)

It may be sheet formulas. I was testing out a Sub that cleared selected cells in a worksheet. The Sub is called by a Command Button on the worksheet to be cleared. The Button Sub is:

Code:
Sub Button2_Click()
    Sheet1.Clear_Character_Sheet
End Sub
I've tried it with/without "Call" in front of Sheet1.Clear_Character_Sheet.
When I click the button (which worked fine in previous version) I get:
Sorry, we couldn't find [Earlier Version Filename]. Is it possible it was moved, renamed, or deleted?

That's exactly what I did—rename it hoping that not being able to find it, the program would go to the new version's Sub.

It didn't. :oops:

You are probably missing variables, functions or routines which you forgot to transfer to the new file, but your new code still calls them from time to time.
I checked for that. That's not the problem.
 

Rufus Clupea

Board Regular
Joined
Feb 11, 2019
Messages
85
What about named ranges? Does your code have any references to named ranges. Those can have links to older versions.
Nope. My project isn't complex enough to make use of/require them. It works out better for me to comment the single cells or few small ranges I'm dealing with.
 

bobsan42

Well-known Member
Joined
Jul 14, 2010
Messages
1,343
Well, I look at it and I make assumptions:
- You are using Form Controls command buttons on a sheet.
- You actually copied the old sheet with the buttons from the old file into the new one.
The I take a wild guess: your buttons are linked to the macros in your old file. (although this would trigger the broken external links dialog normally, if checking is not turned off)

Basically you have to assign locally available macros to your buttons.
Right click on the button, select Assign macro ... and check if the currently assigned macro doesn't lead to your old filename ? If yes correct it - select some of the macros, available in the new one.

I believe this is the problem, but I've been wrong before :)
 

Rufus Clupea

Board Regular
Joined
Feb 11, 2019
Messages
85
I believe this is the problem, but I've been wrong before :)
Not this time—you are correct. I couldn't read the file—too long, and the cursor keys/End didn't work, so I canceled out, tried again, and copied the highlighted file name into Notepad (sheesh! :eek:).

But it got the job done and seems to work fine now. I don't know why, but Button1 doesn't have that problem; I must have done something different(?) :confused:

Hopefully, this will be the end of calling up the old version, but from your earlier, I'll have some other places to check.

Thanks much!
 

Watch MrExcel Video

Forum statistics

Threads
1,090,412
Messages
5,414,261
Members
403,522
Latest member
Abel_excel

This Week's Hot Topics

Top