Setting a macro for every workbook when Excel launches.

A

AbsoluteZero

What I want to do is attach a formatting option to a toolbar button. I can
generate the formatting and record the macro to do it. I then want to attach
the resulting macro to an icon on the toolbar. (I can do all of that. The
macro is fine and attaching it to the button is ok.)

Then I need to put the macro in a place that it will run on any sheet that I
have open but macros will only run from open workbooks. That's where the
Personal Macro Workbook (PMW) comes in. This is a hidden workbook that opens
when Excel is opened but is not visible. (It is standard Excel
functionality.) You save macros there and then they can be run in any open
workbook because the PMW is open although not visible.

I have located 4 XLSTART folders on my machine. I put workbook named PMW is
each one of them. If I click on the PMW file in the XLSTART folder it opens,
is hidden, and the macro runs from any other workbook that I open.

The problem - When Excel starts it should open everything in the XLSTART
folder including PMW. It does not. It opens book.xlt and the PDF maker add-in
but not PMW.

Does anyone know what I can try to get this to work?

Thank you very much!
~zero
 
D

Dave Peterson

I'd just use one XLStart folder.

The one I'd use is the one that excel currently likes:

Open excel
hit alt-f11 to get to the VBE
hit ctrl-g to see the immediate window
type this and hit enter:
?application.StartupPath

For me, I get:
C:\Documents and Settings\username\Application Data\Microsoft\Excel\XLSTART

I'd move all the files to this location (no duplicates, obviously) and delete
the files from the other XLStart folders.
 

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