Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 133
Default How to Call Functions in the Personal Workbook?

I'm working on an Excel Project and would like to use some utility
functions resident in my Personal Workbook. Is there a simple/
standard way to access those functions from the other Project?

Or is cutting and pasting the code the non-elegant, best way?

Thanks Much,

SteveM
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to Call Functions in the Personal Workbook?

In a formula in a cell:
=personal.xls!myfunct(a1:b99)

If you saved your personal workbook as an addin (personal.xla), then you can
refer to the functions in that addin just like they were built into excel:
=myfunct(a1:b99)

If you want to access the functions in your other project (via code), you have a
couple of choices.

You could add a reference in the "receiving" project that points at the
"sending" project.

First, it's probably better to give the "sending" project a nice unique name.
Open the VBE
Hit ctrl-r to see the project explorer
select your workbook's project.
It should look something like: VBAProject (book1.xls)
Hit F4 to see the properties window
Type the new name in the (Name) property

Save this workbook.

Select the "receiving" project
Tools|References
Look for that nice unique name and select it (check it).

Then you can use the functions in that other workbook just like they're built
into VBA.

Dim Resp as long
resp = myFunct(activesheet.range("a1:A7")

======

The second way to have your code call a function in another workbook's project
is to use Application.run:

application.run "'FullfileName.xls'!macroname", myargument
or to return something:
resp = application.run("'fullfilename.xls"'!macroname, myargument)

SteveM wrote:

I'm working on an Excel Project and would like to use some utility
functions resident in my Personal Workbook. Is there a simple/
standard way to access those functions from the other Project?

Or is cutting and pasting the code the non-elegant, best way?

Thanks Much,

SteveM


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom button to call a macro in Personal David Walker Excel Programming 1 July 1st 06 11:45 PM
Call a sub statement in "Personal Macro Workbook" from "ThisWorkbo QC Coug Excel Programming 1 August 26th 05 07:09 PM
Custom Functions in Personal.XLS Alan Cannon Excel Programming 2 July 4th 05 01:34 PM
Personal macro workbook and personal.xls John Kilkenny Excel Discussion (Misc queries) 1 June 14th 05 09:43 PM
Using functions in personal.xls Lorne[_2_] Excel Programming 1 February 1st 04 08:45 PM


All times are GMT +1. The time now is 06:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"