Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Make a Sub/Function global to ALL WorkBooks?

I am using Excel 2007 and XP. I wrote some subroutines and functions that I
would like to be able to use in ANY WorkBook.

As a simple example function:

Function aaa()

aaa = "Results of this function"

End Function

--------------------------------------

In ANY Workbook:

sub zzz()

dim xxx as string

xxx=aaa

end sub

I've been trying ADDins, XLSTART Folder, Personal.XLSB, setting references,
but I seem to be missing something. Setting a reference to the workbook that
contains the function (aaa) does work, but then how do you set the reference
for ALL WorkBooks?

Thanks for any insight,

Art


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Make a Sub/Function global to ALL WorkBooks?

Each workbook will need to have the reference added.

Alternatively, you could use application.run, but then the workbook with the
function will need to be opened (by your code???) first.





ArtDeFart32 wrote:

I am using Excel 2007 and XP. I wrote some subroutines and functions that I
would like to be able to use in ANY WorkBook.

As a simple example function:

Function aaa()

aaa = "Results of this function"

End Function

--------------------------------------

In ANY Workbook:

sub zzz()

dim xxx as string

xxx=aaa

end sub

I've been trying ADDins, XLSTART Folder, Personal.XLSB, setting references,
but I seem to be missing something. Setting a reference to the workbook that
contains the function (aaa) does work, but then how do you set the reference
for ALL WorkBooks?

Thanks for any insight,

Art


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Make a Sub/Function global to ALL WorkBooks?

I use DP's method, modified by having my Macrs.xls file in XLSTART, and
running code to open the main file of macros (in hidden mode) from the
Macros.xls Auto Open.

This keeps the Macros.xls file relatively clean, and distribution much easier

"Dave Peterson" wrote:

Each workbook will need to have the reference added.

Alternatively, you could use application.run, but then the workbook with the
function will need to be opened (by your code???) first.





ArtDeFart32 wrote:

I am using Excel 2007 and XP. I wrote some subroutines and functions that I
would like to be able to use in ANY WorkBook.

As a simple example function:

Function aaa()

aaa = "Results of this function"

End Function

--------------------------------------

In ANY Workbook:

sub zzz()

dim xxx as string

xxx=aaa

end sub

I've been trying ADDins, XLSTART Folder, Personal.XLSB, setting references,
but I seem to be missing something. Setting a reference to the workbook that
contains the function (aaa) does work, but then how do you set the reference
for ALL WorkBooks?

Thanks for any insight,

Art


--

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
group workbooks/files to make global changes? MikeR-Oz New Users to Excel 1 September 12th 08 11:21 PM
Make function available to all workbooks? Damien McBain[_4_] Excel Programming 1 July 17th 08 01:40 AM
Make global Macro/Add-in for all active Workbooks/Sheets SunRace Excel Programming 6 January 28th 08 12:40 PM
how to make a function(vb script) global (as in used from every w. nore Excel Programming 1 December 30th 07 10:46 AM
How to make a function accessible for all workbooks Mark the Shark Excel Programming 2 May 11th 05 02:21 PM


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