Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use a function from another workbook 1

Status
Not open for further replies.

ASAFP

Programmer
Aug 25, 2004
11
IL
How can I use a function from another workbook. It is a public function, I tried to call it by it's name, but it wasn't recognized. Is there other solution except from copy it?

Thanks
 
Is the workbook you're calling the function from open? The other ways you can do this is to set a reference to the workbook, or to create an add-in.
 
Have you set a reference to the open workbook in Tools, References to see if it will work then?
 
I tried to.
When I select the his workbook I get the message
"Name conflicts with existing module, project or object library".

 
Okay, change the name of the project your function is in in the Properties Window in the VBE, otherwise by default it will display as VBAProject in your list.
 
This function is a public function and is used by varios excel sheets.
Will this action (of changing its project name) affect these workbooks?
(under the user defined functions it has the name
WorkBook.xls!FunctionName)
 
It shouldn't do, as you're not altering either the workbook name or the function name. Once you have it referenced, you wont need the workbook name to call the function, just the functio name itself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top