LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 85
Default 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
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
Sharing my macros that I have saved in Personal.xls Jugglertwo Excel Discussion (Misc queries) 4 April 4th 23 11:28 AM
How to connect Excel to stored procedures in SQL database? tskogstrom Excel Discussion (Misc queries) 1 July 3rd 07 09:40 AM
How to connect Excel to stored procedures in SQL database? tskogstrom Excel Discussion (Misc queries) 1 July 2nd 07 03:56 PM
Running sql stored procedures from Excel in-over-his-head-bill Excel Discussion (Misc queries) 0 July 5th 06 06:30 PM
ANOVA procedures and t-test equal variance Noosa Excel Discussion (Misc queries) 1 May 12th 05 06:09 AM


All times are GMT +1. The time now is 12:51 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"