1

For some users of an excel workbook, a login form that is activated on workbook_open appears behind the Internet Explorer 11 window that they use to access the workbook. (Yes, the user has either made this a trusted document or thier security settings in excel automatically enable macros)

I am unable to replicate the problem myself but have seen it occur via screen sharing.

I have tried the workbook.activate and setfocus methods but this doesn't help the users in question. Best case scenario may be to automatically minimise IE from the workbook when the form is activated (if this is possible).

Is there a fool-proof way to ensure that the excel workbook, and specifically the login form, is visible when the user opens the application via IE?

My code as it stands is ludicrously simple having removed failed attempts to remedy the problem:

Private Sub Workbook_Open()
    frmLogin.Show
End Sub

I have not asked many questions on this site. Please let me know if more information is required.

Brent Hackers
  • 183
  • 12
  • Have you tried showing the form modally and then setting focus to a control on the form? – Tim Jun 17 '16 at 12:26
  • @Tim I have tried setting focus to an object on the form (edit: and it turns out that I was already showing the form modally). – Brent Hackers Jun 17 '16 at 12:31
  • Just in case that doesn't work, there are two good SO threads on getting and activating application Windows. http://stackoverflow.com/questions/26277214/vba-getting-program-names-and-task-id-of-running-processes and http://stackoverflow.com/questions/3860250/ole-automation-to-launch-ms-word-and-bring-to-front Perhaps you can either force Excel to the front or minimize IE or force it to the back. – Tim Jun 17 '16 at 12:36
  • @Tim Thanks. I'll give those a read. – Brent Hackers Jun 17 '16 at 12:36

0 Answers0