Macros in Personal.xls...

S

silas

Hi. I created a few helpful macros and saved them in Personal.xls. Now,
wherever I open a file that uses one of the macros, Personal.xls also opens
as a separate (blank) file. This becomes a nuisance as I frequently open two
related files and arrange them horizontally to edit them. When I do that
Personal.xls is included as a third open workbook. If I simply close it the
macros no longer work.

Should I move the macros into "All open Workbooks"? How would I do that?

Thanks.

silas
 
T

T. Valko

Personal.xls is usually opened as a hidden workbook on startup.

Goto the Window menu and select Hide
Choose Personal.xls

This will keep Personal.xls open so you can use the macros but it will be
hidden.

When you go to close Excel it will prompt you to save changes to
Personal.xls, just click Yes/OK (whichever it is!) to save. Then the next
time you start Excel Personal.xls will open as a hidden workbook.
 
S

Scoops

Hi. I created a few helpful macros and saved them in Personal.xls. Now,
wherever I open a file that uses one of the macros, Personal.xls also opens
as a separate (blank) file. This becomes a nuisance as I frequently open two
related files and arrange them horizontally to edit them. When I do that
Personal.xls is included as a third open workbook. If I simply close it the
macros no longer work.

Should I move the macros into "All open Workbooks"? How would I do that?

Thanks.

silas

Hi silas

Biff's answer works but you could also include the line below just
before your End Sub:

ThisWorkbook.Close 0

(the '0' says "don't save any changes").

When you call the macro in your Personal.xls book (or any other book),
the macro will execute and then close the book containing it.

Regards

Steve
 
S

silas

Scoops said:
Hi silas

Biff's answer works but you could also include the line below just
before your End Sub:

ThisWorkbook.Close 0

(the '0' says "don't save any changes").

When you call the macro in your Personal.xls book (or any other book),
the macro will execute and then close the book containing it.

Regards

Steve

Thank you both very much for your excellent suggestions. You've solved an
annoying problem for me.

silas
 

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