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
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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.
 
Upvote 0
What about named ranges? Does your code have any references to named ranges. Those can have links to older versions.
 
Upvote 0
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.
 
Upvote 0
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.
 
Upvote 0
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 :)
 
Upvote 0
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! :eeek:).

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(?) :???:

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!
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,171
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top