Custom Add-in function carries pathname with it?

bcruden

New Member
Joined
Mar 17, 2004
Messages
5
Hello,

I've written a custom function, put it in an .xla file and loaded it into excel as an add-in. All good.

The problem I have is when I use the function in a worksheet, then port that worksheet to a different computer, the worksheet retains the path and no longer works because the path is different (different OS -- 98 to XP). I have to manually remove all the path references before using the sheet. Find-replace makes this relatively painless, but it seems like it should be altogether unnecesary.

How do you make excel drop the path? It seems like, since the add-in is loaded into excel on both computers, it should know where the file is and not need to retain the pathname within the worksheet?

Thanks,
Brett
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
Hi - Welcome to the board

How are you refering to items that use the path? There is probably a better way. Post some code so we can help.
 

bcruden

New Member
Joined
Mar 17, 2004
Messages
5
I don't think it's the VB code, something about the workbook? Let me get more specific.

I've got my custom function (interpolate), and I refer to it in the worksheet as, for instance:

=interpolate(G2,$A$3:$A$1787,$B$3:$B$1787)

This on my WinXP machine. When I port this worksheet over to my other machine (Win 98), this becomes:

='C:\Documents and Setting...\CustomFns.xla'!interpolate(G2,$A$3:$A$1787,$B$3:$B$1787)

CustomFns.xla is installed as an add-in on both computers and is exactly the same file on both computers, just residing in different directory paths. Why does Excel retain the pathname? I never enter the pathname myself, this excel does automatically. Should I be doing something different?

Another problem unrelated, but since I'm here: My custom function tries to recalculate itself any time I change anything on the worksheet, even when the change I make does not impact this function. What's that all about?
 

DRJ

MrExcel MVP
Joined
Feb 17, 2002
Messages
3,853
Code:
Application.Volatile (False)
Use that to make the function not recalculate all the time.
 

bcruden

New Member
Joined
Mar 17, 2004
Messages
5
Application.Volatile (False) does not seem to do anything. The function still recalculates when any cell value is changed. Any ideas?

And my question about the pathname still remains open, too...
 

Watch MrExcel Video

Forum statistics

Threads
1,123,281
Messages
5,600,720
Members
414,401
Latest member
grenona2020

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
Top