ChemCougar82

New Member
Joined
Jul 28, 2005
Messages
9
This is a frequent problem for me. When I save a macro-enabled workbook that contains function procedures into a new file name, when the workbook attempts to use the function procedures, it is looking for the function procedures in the old workbook name, not the new one. Borrowing some language from the HTML world, Excel automatically inserts an "absolute reference" to the old workbook location into the function calls in my worksheets. The only way I currently know to fix this is to manually remove those absolute references. I think there should be a way to tell the workbook that I always want to refer to functions in the current workbook, not in the original workbook -- what I would call a "relative reference".

Here's a hypothetical example of the problem I'm referring to, in case I haven't used some of the correct language to describe the problem. I have an original workbook C:\MyWorkbook.xlsm. In that workbook, there is a function procedure called "MyFunction()". In my workbook, the function calls look like this:

=MyFunction()

I save the workbook with that function in it and email it to a friend. He save's the file as "MyFriendsWorkbook.xlsm". After he saves the file, the function calls don't work. When he looks at them, this is what he sees:

='C:\MyWorkbook.xlsm'!MyFunction()

The function procedure is still in the copy of the workbook that my friend has, but none of the function calls will work until he manually deletes all the absolute reference strings that were added by Excel. Who knows how to stop this from happening so that there is no manual cleanup needed?
 

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.
This is manual, however, couldn't he simply use the CTL-H to replace 'C:\MyWorkbook.xlsm'! with nothing in the workbook leaving MYFUNCTION() ?
 
Upvote 0
Thanks for the suggestion, and yes the user could do that, only this is a case where there are many users and also many workbooks, and I don't want the users to be bothered doing that. I think there should be a better way that is related to how the functions are defined or referenced.
 
Upvote 0

Forum statistics

Threads
1,216,614
Messages
6,131,739
Members
449,668
Latest member
michaeljamesellis

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