using macro from a different workbook

K

Kevin

Hi, this is actually a question from a friend that I couldn't answer. She
works at a school with a proprietary program that does attendance. Several
times each day she exports a list to excel, but needs most of the columns
deleted and one added. I made her a macro to do this and it works fine. The
problem is, after the initial run, the workbook containing the macro is
minimized and she then exports another list, but the macro won't run again
unless she reopens the workbook containing the macro. She also said there is
no personal.xls listing when looking under macros. I'm thinking this may be
the problem. Is there a way we can call up the macro from the other workbook
in a convenient way? The other program opens a new instance of excel each
time you export a list, also...hope I explained correctly. Thanks for any
help, -Kevin
 
C

CLR

I do similar little programs to help some of my co-workers. What I do is
write a small program that will go and get an Excel file (list) and import it
into the HelperProgram, which then manipulates it however the user wants, and
saves it out to wherever they want by whatever filename (with datecode) they
want. Next time it can be simply run again with a new list, or can be
automated to run against a "list of lists".

Vaya con Dios,
Chuck, CABGx3
 
R

rdwj

Kevin,
The way I understand your explanation is that the propriety program opens a
new xls application rather then just an xls sheet.
One thing you can consider is defining how xls opens.
Under Tools, Options, General you can define a workbook to be opened every
single time that the xls application is called under "Alternate startup file
location". If you specify the file with the macro in that box, the macro file
is always opened when a new xls application is called.

Let me know if this helps

rdwj
 
K

Kevin

Hi, you're right..it does open the program each time an export happens. It
appears that after the export, if she opens the workbook with the macro
second, it works fine in the first workbook. Do you know if this would happen
if she used you're suggestion?
 
D

Dave Peterson

I like to either add an option to one of the toolbars or even create a dedicated
toolbar that would allow the user easy access to the macro.

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)

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
or
http://www.rondebruin.nl/ribbon.htm
 
R

rdwj

yes - should do.
rdwj

Kevin said:
Hi, you're right..it does open the program each time an export happens. It
appears that after the export, if she opens the workbook with the macro
second, it works fine in the first workbook. Do you know if this would happen
if she used you're suggestion?
 
G

Gary

When creating the Macro there is a drop box names "Store macro in:" - choose
Personal Macro Workbook

This will create personal.xls and the macro will be available no matter what
workbook is opened. This would have to be done on any machine that needs the
macro.

hth
 

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