Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Sharing VBA procedures; alternative to personal.xls?
I have a workbook with a set of VBA procedures (subs and functions).
I want to use the same procedures in another (new) workbook. I know that I could cut-and-paste into the VBA editor. I also know that I could put the shared procedures into personal.xls. I believe there is a "better" way -- at least, a way that I prefer, and a way that I have used in the past without problems. This has been explained in these newsgroups, but I cannot find the explanation. And what I remember is not working for me. As I recall, all I need to do is open the original workbook that contains the VBA procedures in the same Excel instance in which I open the new workbook (File / New / Blank Workbook). That does not work for me now, regardless of whether I open the original workbook before or after creating the new workbook. What am I doing wrong? Oh, I __can__ access the subs in the original workbook. Just not the functions. Does this method of sharing VBA procedures work only for subs? Is there a special way that I must declare the functions for this method of sharing to work? I have declared the functions simply as "function foobar(arglist) as type". I notice that the module that contains the VBA procedures is in one VBA project named for the original workbook, whereas the new workbook is in a separate VBA project. Is that the problem? Or is that correct, namely that each workbook is a separate VBA project? Bottom line: How can I share VBA procedures -- functions as well as subs -- between workbooks, ideally without using personal.xls? FYI, I am using Office Excel 2003. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sharing my macros that I have saved in Personal.xls | Excel Discussion (Misc queries) | |||
How to connect Excel to stored procedures in SQL database? | Excel Discussion (Misc queries) | |||
How to connect Excel to stored procedures in SQL database? | Excel Discussion (Misc queries) | |||
Running sql stored procedures from Excel | Excel Discussion (Misc queries) | |||
ANOVA procedures and t-test equal variance | Excel Discussion (Misc queries) |