Macro to load on open

  • Thread starter Thread starter Steve Chatham
  • Start date Start date
S

Steve Chatham

Is there a way to have the default workbook to open a macro?

What I am wanting to do is to make a change to Excel that would load a macro
to delete hyperlinks (cells.hyperlinks.delete) that'd load when I opened
excel, so all I'd have to do after pasting a web page into excel is to run
that macro.

Have not found a way to do this without a lot of trouble, and would need to
have a method of letting less-than-expert users be able to do this easily.
I was thinking that making excel load this macro on open would be the best
way to do it.

SC
 
Steve,

Put a macro called Auto_Open in the workbook, or add the code to the
Workbook_Open event.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Hi Steve

If you want to use the macro in all your workbooks you can copy the macro in
your personal.xls.
This is a (normally) hidden workbook that is loaded automatically by Excel.
When you record a macro, you have the option of recording it to your
Personal Macro Workbook.
The file, Personal.xls, is stored in your \XLStart directory.

The easiest is to record a dummy macro and choose Personal Macro Workbook.
Excel create the file for you this way.
Then copy your macro in this file and delete the dummy macro.

You can aso save the file with the macro as a add-in
 
If you just mean you need the macro available, you can place it in your
personal.xls

if you want it triggered by performing a download, that wouldn't be as
straightforward.
 
I was just wanting the macro to be there whenever I opened excel - i.e. if I
opened an excel file from you, I'd like to be able to run this code on it.

I've looked in the XLStart folder on my hard drive - it appears to be empty,
even with "hide" turned off.

Could this be loaded from elsewhere? Or do I need to take a worksheet and
save it to there as personal.xls?

Steve
 
No, just record a macro that does nothing, and choose the Personal Macro
Workbook option.

What is loading these hyperlinks that you want to remove if you don't
already have such a book?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
We've got an asp.net application that produces drilldown reports from a sql
database.

You can click on a customer, and then drill thru PO's, etc. There's a radio
button at the top for web or excel, and web produces the drill thru, but
excel will prompt you to save the screen as-is in an excel workbook. Only
problem, is that it doesn't strip out the hyperlinks that you used to get to
the point you were at.

To my knowledge, there's no "good" way to get a web page into excel, at
least not in dotnet.
Thanks for the info.
SC
 
Back
Top