ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   public macros (https://www.excelbanter.com/excel-programming/306850-public-macros.html)

TommyBoy

public macros
 
i created a windows form that allows you to select a pay roll file, the
pay roll file has a sheet for each employee, the form lets you select
each employee you want to their sheet to. I created a macro in excel
that emails the sheet as the body and everything is working fine. My
problem is that there will be a different pay roll file for each pay
period, how do i make my macro public so any pay roll file can access
it? Thanks in advance

Bob Phillips[_6_]

public macros
 
Tommy,

Macros in a standard module are b y default public, unless you explicitly
make them private. The trick is to have an argument that allows the variable
file name to be passed.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"TommyBoy" wrote in message
...
i created a windows form that allows you to select a pay roll file, the
pay roll file has a sheet for each employee, the form lets you select
each employee you want to their sheet to. I created a macro in excel
that emails the sheet as the body and everything is working fine. My
problem is that there will be a different pay roll file for each pay
period, how do i make my macro public so any pay roll file can access
it? Thanks in advance




Tom Ogilvy

public macros
 
An additional method is to put your code in an addin, put it in a common
network drive and let you users select it in Tools=Addins. You would also
have code in the workbook_open event of the addin to create a toolbar to run
your macros.

http://msdn.microsoft.com/library/ba...n_addins97.htm
http://msdn.microsoft.com/library/of...exceladdin.htm
http://www.microsoft.com/exceldev/tips/addins.htm
These are about distributing applications

--
Regards,
Tom Ogilvy


"TommyBoy" wrote in message
...
i created a windows form that allows you to select a pay roll file, the
pay roll file has a sheet for each employee, the form lets you select
each employee you want to their sheet to. I created a macro in excel
that emails the sheet as the body and everything is working fine. My
problem is that there will be a different pay roll file for each pay
period, how do i make my macro public so any pay roll file can access
it? Thanks in advance




john doe

public macros
 
Thanks a lot tom!



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


All times are GMT +1. The time now is 10:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com