> The personal macro workbook is probably the best place. Why don't you add a
> Workbook_open macro to the PMW to minimize ort hide the workbook?
On 7/27/07 12:39 PM, in article 46aa1fdc@news1-rz-ap.ethz.ch, "Markus S"
<youcontrol@hispeed.ch> wrote:
>> The personal macro workbook is probably the best place. Why don't you add a
>> Workbook_open macro to the PMW to minimize ort hide the workbook?
[quoted text clipped - 3 lines]
> - how do I create a 'minimize' macro? Trying to record it did not work.
> - how do I assign a macro to be executed upon opening a file?
Open the personal macro workbook. Go to the visual Basic Editor (Option-F11)
or Tools-Macro-Visual Basic Editor. Double click on the ThisWorkbook object
to get a code page. Then paste in the following:
Private Sub Workbook_Open()
ThisWorkbook.Windows(1).Visible = False
End Sub
This will hide the PMW, but there will need to be another workbook window
(usually Workbook1) visible or the macro will fail.
> And also, if I close the last Excel file (except for the PMW) and
> switch to another app and then switch back to Excel, this minimized PMW
> will be un-minimized again. Would a Workbook_open macro also take care
> of that?
No, this is probably an artifact (and bug) where the visual basic editor
becomes active if it is open. You can close the VBE before you save the PMW,
then it should be OK. You can paste the same line of code into the window
activate event also. While in the VBE after pasting in the above code, pull
down the left dropdown to select Workbook, then pull down the right drop
down to select window activate, and type in or paste the middle line above.
> But mabye if Excel does not provide for a central location to store
> macros so that they are always accessible, I should not use macros for
> my purpose but rather add-ins?
I'm not sure what your purpose is. The PMW is the best and simplest way to
make macros accessible. You can, also create an add-in, but you'll probably
find that that will be more trouble than it's worth.

Signature
Bob Greenblatt [MVP], Macintosh
bobgreenblattATmsnDOTcom
Markus S - 27 Jul 2007 20:13 GMT
> Open the personal macro workbook. Go to the visual Basic Editor (Option-F11)
> or Tools-Macro-Visual Basic Editor. Double click on the ThisWorkbook object
[quoted text clipped - 5 lines]
> This will hide the PMW, but there will need to be another workbook window
> (usually Workbook1) visible or the macro will fail.
Works perfectly, thanks a lot. The PMW stays hidden (even better than
minimized) whatever I do. I couldn't ask for more.
Now why is this not the default behaviour of the PMW? What would be the
advantages of constantly having a blank workbook labelled PMW arround?