Log in

View Full Version : Strange behavoiur of Workbook_Open() and Worksheet_Activate() events



AerosAtar
10-28-2013, 07:50 PM
I have a Workbook_Open() event on a workbook that maximises the application and window (i.e. the workbook).
In the same workbook I have a Worksheet_Activate() event on the various worksheets that sets Zoom to 100% and resets the position of buttons/icons to where they should be.

These events all work perfectly when I open the workbook from my computer or from Sharepoint, however they do not work when opening the workbook from our other UCM system (Oracle).

It isn't a huge issue, really, but it is an annoyance that I could do without if possible. The reasons behind these events are to get around an issue we find occuring frequently where the workbook opens 'off-window' and cannot be seen without using the Arrange Panes option, and to make sure that the worksheets are legible.

Has anyone else come across this issue and/or can suggest potential workarounds?

Excel Fox
10-28-2013, 08:07 PM
What is this UCM system? Does it have macro enabled?

AerosAtar
10-28-2013, 09:23 PM
Oracle Content Server (Oracle Content Server (http://www.oracle.com/technetwork/middleware/content-management/cs-088869.html)). Unfortunately I only have user-level access so I cannot answer your other question. However, all of the other events (Worksheet_Change, On_Click, etc) work just fine regardless of where the workbook is opened from.

Excel Fox
10-28-2013, 09:59 PM
So you're saying on the Workbook_Open and _Activate events don't fire, but the other events work fine? Certainly strange. Did you try Auto_Open() in the module?

AerosAtar
10-29-2013, 06:17 PM
Auto_Open(), which does not seem fully capable anyway (it doesn't recognise maximising the application window when recording), also does not run.

For reference, here is the Workbook_Open() code:


Sub workbook_Open()

'Always maximise the Excel window and workbook
Application.WindowState = xlMaximized
ActiveWindow.ActivateNext
ActiveWindow.WindowState = xlMaximized

End Sub

I found that the Worksheet_Activate() code actually is firing - I just didn't notice because the Workbook_Open() was failing.