Launch Macro

M

Mark Durrenberger

Excel 2000...

Hi, I'm trying to get a VBA macro to launch when I double click on a
worksheet icon somewhere on my desktop.

This macro should launch no matter what workbook I open...
The macro does or does not have to launch if I open a workbook from within
excel.

Is an ADD-in the only way to go?

Also, I have quite a bit of experience with add-ins for MS Project
(2000/2002) but the only thing that seems to be the same between project and
excel add-ins is the company name - am I confused?

Thanks,
Mark
 
D

Dave Peterson

Do you mean you want a macro to start when ever you start excel? Or do you mean
you want a macro to run whenever you open an existing file?

(If you really meant just when you open a file via doubleclicking, I'm not sure
excel distinguishes between File|Open and doubleclicking--I've never noticed any
difference.)

If you want it to run whenever you start excel, you may want to build your macro
and put it in a workbook that's stored in XLStart. (Or even make it an addin
and use Tools|addins to install it.)

If you wanted a macro to run whenever you opened a workbook, you'd need an
application event. Chip Pearson has some nice notes at:

http://www.cpearson.com/excel/AppEvent.htm
 
M

Mark Durrenberger

Dave,
Thanks, the cpearson link appears to have given me exactly what I need.

I'll try to explain again,
If I double click on an excel workbook somewhere on my disk, I want a macro
to run - so it really is an application level event not a workbook level
event (the cpearson web site even gave me the lingo!)...

Mark



--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is
that failure comes as a complete surprise and is not
preceded by a period of worry and depression.

- Sir John Harvey-Jones
 
D

Dave Peterson

Ah, Chip's site even had an example workbook that you could try out. Download
it and see if that helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top