I have this problem too, and it was reproduced perfectly by a macro-enabled worksheet which was a great annoyance for all the users of my tooling. This particular macro worksheet performs the following on startup:
- Workbook_Open event launches function
- Function opens form and minimizes macro-enabled worksheet
- Bug is produced
My solution now is the following:
| Private Sub Workbook_Open()<br><br><br>Dim wkbActive as Workbook<br><br><br>Set wkbActive = ActiveWorkbook<br><br><br>...<br><br><br>Call wkbActive.Activate<br><br>End Sub |
(I have also inserted this or similar code at every other window operation and workbook open operation)
To me it seems that this bug is that Excel fails to pass focus to the next workbook when a workbook is minimized, and/or that it can pass focus to a minimized workbook. Obviously microsoft should address this ASAP, but in the meanwhile
those of us who use macro-enabled workbooks might fix it ourselves by manually handling workbook activation.