PC Review


Reply
Thread Tools Rate Thread

called macro

 
 
Rick
Guest
Posts: n/a
 
      19th Dec 2007
Where does one store a called macro that would be used by many excel
programs? And how is this procedure done, as well as how is the macro coded
Public or Private?
 
Reply With Quote
 
 
 
 
TG
Guest
Posts: n/a
 
      19th Dec 2007
On Dec 19, 10:51 pm, Rick <R...@discussions.microsoft.com> wrote:
> Where does one store a called macro that would be used by many excel
> programs? And how is this procedure done, as well as how is the macro coded
> Public or Private?


Place the macro in i.e. personal.xla placed in the folder XLStart. Any
files in XLstart will be loaded when Excel is started.

If the macro is Private it won't be visible in the Run macro dialog
(Alt-F8), if you _allways_ calls the macro from menus or other macros
you could set it Private. But if you need to activate the Macro from
Run macro dialog, it should be Public.

/Tommy, DK
 
Reply With Quote
 
FSt1
Guest
Posts: n/a
 
      19th Dec 2007
hi
2 ways.
1. store the macros a file called personal.xls and save it to the xlstart
folder.
i am using xp and the xlstart folder is located at ...
c:\program files\microsoft office\Office 10\xlstart\
it varies per ref level. the personal.xls file is hidden and opens when xl
opens and all macros in the personal file are available to use anywhere,
anytime.
this is how i do it and have been for 12~+ years. you can assign the macros
to sheet command buttons, toolbar icons or just run them from the menu tree...
tools\macro\macros....
you can also use the call command.
2. instead of a personal.xls file, make it and addin. works but i have never
used this technique so i can't say much about it.
as to public or private...
all of my macros in my personal.xls are just plain ol', run-of-the-mill subs.
public or private are optional. in vb help, type the word "sub" then click
on "calling subs and function procedures." it will explain the difference.
but as to my personal macros, "sub" does the trick.

hope this helped.
regards
FSt1



"Rick" wrote:

> Where does one store a called macro that would be used by many excel
> programs? And how is this procedure done, as well as how is the macro coded
> Public or Private?

 
Reply With Quote
 
Rick
Guest
Posts: n/a
 
      19th Dec 2007
Thanks for the info, I'll give it a try.

"FSt1" wrote:

> hi
> 2 ways.
> 1. store the macros a file called personal.xls and save it to the xlstart
> folder.
> i am using xp and the xlstart folder is located at ...
> c:\program files\microsoft office\Office 10\xlstart\
> it varies per ref level. the personal.xls file is hidden and opens when xl
> opens and all macros in the personal file are available to use anywhere,
> anytime.
> this is how i do it and have been for 12~+ years. you can assign the macros
> to sheet command buttons, toolbar icons or just run them from the menu tree...
> tools\macro\macros....
> you can also use the call command.
> 2. instead of a personal.xls file, make it and addin. works but i have never
> used this technique so i can't say much about it.
> as to public or private...
> all of my macros in my personal.xls are just plain ol', run-of-the-mill subs.
> public or private are optional. in vb help, type the word "sub" then click
> on "calling subs and function procedures." it will explain the difference.
> but as to my personal macros, "sub" does the trick.
>
> hope this helped.
> regards
> FSt1
>
>
>
> "Rick" wrote:
>
> > Where does one store a called macro that would be used by many excel
> > programs? And how is this procedure done, as well as how is the macro coded
> > Public or Private?

 
Reply With Quote
 
Jim Thomlinson
Guest
Posts: n/a
 
      19th Dec 2007
By default if you do not specify public or private then it's public.

Sub Whatever()
is exactly the same as
Public Sub Whatever()

I personally always specify whether it is public or private. That way I know
that I took the time to actually think about what would be the appropriate
designation for the sub or function...
--
HTH...

Jim Thomlinson


"FSt1" wrote:

> hi
> 2 ways.
> 1. store the macros a file called personal.xls and save it to the xlstart
> folder.
> i am using xp and the xlstart folder is located at ...
> c:\program files\microsoft office\Office 10\xlstart\
> it varies per ref level. the personal.xls file is hidden and opens when xl
> opens and all macros in the personal file are available to use anywhere,
> anytime.
> this is how i do it and have been for 12~+ years. you can assign the macros
> to sheet command buttons, toolbar icons or just run them from the menu tree...
> tools\macro\macros....
> you can also use the call command.
> 2. instead of a personal.xls file, make it and addin. works but i have never
> used this technique so i can't say much about it.
> as to public or private...
> all of my macros in my personal.xls are just plain ol', run-of-the-mill subs.
> public or private are optional. in vb help, type the word "sub" then click
> on "calling subs and function procedures." it will explain the difference.
> but as to my personal macros, "sub" does the trick.
>
> hope this helped.
> regards
> FSt1
>
>
>
> "Rick" wrote:
>
> > Where does one store a called macro that would be used by many excel
> > programs? And how is this procedure done, as well as how is the macro coded
> > Public or Private?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Test if macro is called by another macro Susan Microsoft Excel Programming 0 24th Jun 2008 03:19 PM
Re: Test if macro is called by another macro Bob Phillips Microsoft Excel Programming 0 24th Jun 2008 03:18 PM
Need syntax for RUNning a Word macro with an argument, called from an Excel macro Steve Microsoft Excel Programming 3 6th Jul 2006 07:42 PM
Which workbook called a macro? mika. Microsoft Excel Misc 0 24th Sep 2003 02:28 PM
How to know which workbook the macro was called from? mika. Microsoft Excel Misc 2 22nd Sep 2003 06:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:13 PM.