XL07 Open Macro to use Own Macros

petermoran
NewLounger
Posts: 4
Joined: 28 Jul 2010, 09:07

XL07 Open Macro to use Own Macros

Post by petermoran »

Hi,

I have a number of workbooks which contain their own macros.

I would like to have an Open macro which resets the Alt-F8 window so it shows just macros in "This Workbook" rather that all open workbooks.

Thus when I use Alt-F8, the window shows the macros I want to use.

And likewise when it closes, the situation reversed to use "All Open Workbooks" once again, if possible.

I have tried with recording a macro but got nowhere.

Any help greatly appreciated.

Regards,

Peter Moran

User avatar
HansV
Administrator
Posts: 78665
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: XL07 Open Macro to use Own Macros

Post by HansV »

The Macros dialog is - for obvious reasons - not exposed in the Visual Basic Editor. It's possible to use SendKeys to display the macros dialog with macros from the active workbook only, but I assume that you don't want to display this dialog each time the workbook is opened. Moreover, SendKeys is notoriously wacky.
Best wishes,
Hans

petermoran
NewLounger
Posts: 4
Joined: 28 Jul 2010, 09:07

Re: XL07 Open Macro to use Own Macros

Post by petermoran »

Hi Hans,

Thanks for the reply.

I have noticed that once a workbook is opened and the Alt-F8 window is set it sticks until it is changed again, at least while Excel continues to be open.

I have previously come across problems with Sendkeys.

No easy solution, it appears!

Thanks again.

User avatar
HansV
Administrator
Posts: 78665
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: XL07 Open Macro to use Own Macros

Post by HansV »

I'm afraid that there is no easy solution indeed. Sorry!
Best wishes,
Hans