Search code examples
excelvbauserformmultiple-monitors

Display Excel on the primary monitor


I have a Userform opens automatically when opening an excel file. It has some display problems, as the option buttons disappear when scrolling down the form. this problem only occurs when i have 2 monitors (main and secondary). I noticed these two scenarios:

  1. If i open any Excel file and make it full screen in the main screen then close it, then open the userform it works fine!
  2. If i open any excel file and move it to the secondary screen then close it and open the userform, the problem occurs!

So,my questions is:

Is there any way to force Excel to be opened as full screen in the main screen?


Solution

  • Add this to the Workbook_Open() event procedure, and you'll be able to open the workbook in full-screen mode on the primary monitor.

    Private Sub Workbook_Open()
       Application.Top = 0
       Application.Left = 0
       Application.DisplayFullScreen = True
    End Sub