Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Dynamic Link Library

I am trying to get an Excel macro to run from any workbook by placing a
button on the menu bar. I do not know which DLL to include in the Public
Declaration. Can anyone advise me?
Thanks.
Bugzee
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Dynamic Link Library

I'm not sure what you are trying to do. You only need DLL decarations if you
are running a compiled code usually an .exe file or some other executable.
VBA macros are not executables. So if you are running a macro from any
microsoft office product to any other microsoft office product yo udon't need
any declarations.

VBA (Visual Basic) macro can either be placed in every workbook which is the
normal method for executing a macro. When you copu a workbook the macro is
automatically copied. You can also run a macro in another workbook (or a
macro in another microsoft office product). Is your question how to run a
macro in another workbook?

"Bugzee" wrote:

I am trying to get an Excel macro to run from any workbook by placing a
button on the menu bar. I do not know which DLL to include in the Public
Declaration. Can anyone advise me?
Thanks.
Bugzee

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Dynamic Link Library

Thanks very much for your help, Joel. What I am trying to achieve is to have
a macro to set my default formats for a type of report. I would like this
macro to be accessible from any workbook. Any advice on how this can be done?
Thanks,
Bugzee

"joel" wrote:

I'm not sure what you are trying to do. You only need DLL decarations if you
are running a compiled code usually an .exe file or some other executable.
VBA macros are not executables. So if you are running a macro from any
microsoft office product to any other microsoft office product yo udon't need
any declarations.

VBA (Visual Basic) macro can either be placed in every workbook which is the
normal method for executing a macro. When you copu a workbook the macro is
automatically copied. You can also run a macro in another workbook (or a
macro in another microsoft office product). Is your question how to run a
macro in another workbook?

"Bugzee" wrote:

I am trying to get an Excel macro to run from any workbook by placing a
button on the menu bar. I do not know which DLL to include in the Public
Declaration. Can anyone advise me?
Thanks.
Bugzee

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Dynamic Link Library

I you are the only one who is going to use this macro then yo may consider
putting the macro in a personal.xls workbook. The personal workbook macros
will be available to you whenever you open up any workbook.

"Bugzee" wrote:

Thanks very much for your help, Joel. What I am trying to achieve is to have
a macro to set my default formats for a type of report. I would like this
macro to be accessible from any workbook. Any advice on how this can be done?
Thanks,
Bugzee

"joel" wrote:

I'm not sure what you are trying to do. You only need DLL decarations if you
are running a compiled code usually an .exe file or some other executable.
VBA macros are not executables. So if you are running a macro from any
microsoft office product to any other microsoft office product yo udon't need
any declarations.

VBA (Visual Basic) macro can either be placed in every workbook which is the
normal method for executing a macro. When you copu a workbook the macro is
automatically copied. You can also run a macro in another workbook (or a
macro in another microsoft office product). Is your question how to run a
macro in another workbook?

"Bugzee" wrote:

I am trying to get an Excel macro to run from any workbook by placing a
button on the menu bar. I do not know which DLL to include in the Public
Declaration. Can anyone advise me?
Thanks.
Bugzee

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Dynamic Link Library

Thanks again Joel. But what if I wanted to make the macro available to others
in my office?
Thanks.
Bugzee

"joel" wrote:

I you are the only one who is going to use this macro then yo may consider
putting the macro in a personal.xls workbook. The personal workbook macros
will be available to you whenever you open up any workbook.

"Bugzee" wrote:

Thanks very much for your help, Joel. What I am trying to achieve is to have
a macro to set my default formats for a type of report. I would like this
macro to be accessible from any workbook. Any advice on how this can be done?
Thanks,
Bugzee

"joel" wrote:

I'm not sure what you are trying to do. You only need DLL decarations if you
are running a compiled code usually an .exe file or some other executable.
VBA macros are not executables. So if you are running a macro from any
microsoft office product to any other microsoft office product yo udon't need
any declarations.

VBA (Visual Basic) macro can either be placed in every workbook which is the
normal method for executing a macro. When you copu a workbook the macro is
automatically copied. You can also run a macro in another workbook (or a
macro in another microsoft office product). Is your question how to run a
macro in another workbook?

"Bugzee" wrote:

I am trying to get an Excel macro to run from any workbook by placing a
button on the menu bar. I do not know which DLL to include in the Public
Declaration. Can anyone advise me?
Thanks.
Bugzee



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Dynamic Link Library

This doesn't have anything to do with DLLs.

And since you're sharing with others, don't share a workbook named
personal.xls. Excel only allows one workbook with that name to be open in any
particular instance.

If the recipients have their own personal.xls workbook, then they'll have to
close that file and open yours.

Instead create a new utility workbook that contains all your macros. Name it
BugZeeUtils.xls and tell them to save it in a particular location on their
harddrive (like: C:\ExcelUtilities\bugzeeutils.xls

This file can have code that creates the button on the toolbar when it opens and
removes the button when it closes.

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

In xl2007, those toolbars and menu modifications will show up under the addins.

And if you use xl2007:

If you want to learn about modifying the ribbon, you can start at Ron de Bruin's
site:
http://www.rondebruin.nl/ribbon.htm
http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an
addin)
or
http://www.rondebruin.nl/2007addin.htm

Bugzee wrote:

I am trying to get an Excel macro to run from any workbook by placing a
button on the menu bar. I do not know which DLL to include in the Public
Declaration. Can anyone advise me?
Thanks.
Bugzee


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Dynamic Link Library

Thanks very much guys. You have been very helpful.
Kind regards
Bugzee

"Dave Peterson" wrote:

This doesn't have anything to do with DLLs.

And since you're sharing with others, don't share a workbook named
personal.xls. Excel only allows one workbook with that name to be open in any
particular instance.

If the recipients have their own personal.xls workbook, then they'll have to
close that file and open yours.

Instead create a new utility workbook that contains all your macros. Name it
BugZeeUtils.xls and tell them to save it in a particular location on their
harddrive (like: C:\ExcelUtilities\bugzeeutils.xls

This file can have code that creates the button on the toolbar when it opens and
removes the button when it closes.

For additions to the worksheet menu bar, I really like the way John Walkenbach
does it in his menumaker workbook:
http://j-walk.com/ss/excel/tips/tip53.htm

Here's how I do it when I want a toolbar:
http://www.contextures.com/xlToolbar02.html
(from Debra Dalgleish's site)

In xl2007, those toolbars and menu modifications will show up under the addins.

And if you use xl2007:

If you want to learn about modifying the ribbon, you can start at Ron de Bruin's
site:
http://www.rondebruin.nl/ribbon.htm
http://www.rondebruin.nl/qat.htm -- For macros for all workbooks (saved as an
addin)
or
http://www.rondebruin.nl/2007addin.htm

Bugzee wrote:

I am trying to get an Excel macro to run from any workbook by placing a
button on the menu bar. I do not know which DLL to include in the Public
Declaration. Can anyone advise me?
Thanks.
Bugzee


--

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
VBA Extensibility library and dynamic code compilation John.Greenan Excel Programming 9 March 8th 07 01:57 AM
DDE link cache in DDEML library - is it so? anand[_3_] Excel Programming 1 March 24th 05 06:25 PM
how do i create an import library to link to a dll for use in exc. Ashley Excel Programming 0 February 26th 05 10:25 AM
how to write dynamic link library for excel to use? Desmond Leung Excel Programming 0 July 30th 03 07:47 AM
how to write dynamic link library for excel to use? Desmond[_2_] Excel Programming 0 July 28th 03 05:35 AM


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