Wrox Programmer Forums
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 5th, 2007, 09:36 AM
Registered User
 
Join Date: May 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default User-defined functions

Can User-defined functions be written so that they will work on every computer on a network?

My situation:

I wrote a function called "Address1" that returns the street address for a customer. (Of course, I have Address2 and so forth...my application prints checks.) We don't have a server, so common files are stored in a "Common Area" folder on one of the computers with peer-to-peer file sharing. The Address1 function is in an xla file in the "Common Area" folder. Excel on every computer is setup to load the xla.

Here's what happens:

Any user can enter the function in a cell ("=Address1("customer")) and it works fine. HOWEVER, if the file is saved and reopend by a different computer on the network, the path to the function is inserted in the cell ("=/path info/Common Area/Address1("customer")) and the function does not work.

Is there a solution short of writing an automation add-in?

Thanks,
Fred

 
Old May 7th, 2007, 10:28 AM
Friend of Wrox
 
Join Date: Feb 2007
Posts: 163
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Sounds like the add-in isn't getting loaded properly or the path to the xla is differently mapped on different machines. This will cause Excel to complete the formula with the last known 'good' path.

For machines that are to use the add-in click tools > add-in and select the appropriate add-in. For custom ones you'll probably need to 'browse' for the file.

Machines that open the file showing the full path will need to exit it without saving or the path will be in every instance.

Hope this helps.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Indexing tables in user defined functions A17560127 SQL Server 2005 1 July 21st, 2008 03:56 AM
Portability of User Defined Functions (UDFs) fredh Excel VBA 0 May 3rd, 2007 06:07 PM
Number format in User Defined Functions Moose35 Excel VBA 1 February 17th, 2005 05:23 AM
User-Defined Functions - How to recalculate? kmoran Excel VBA 1 October 5th, 2004 02:45 AM
user defined functions in vba re_anu Access VBA 2 March 3rd, 2004 01:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.