In this article we will learn how to activate full-screen feature and disable window resize button using VBA.
Logic explanation
We have created “ActivatingFullScreen” macro to change the property of Excel application to enable the full-screen feature.
We have used window resize event of the workbook to disable the window resize button.
Code explanation
Application.DisplayFullScreen = True
We have set DisplayFullScreen property of the application to True to enable full-screen feature.
Wn.WindowState = xlMaximized
We have set WindowState property of the Excel window to xlMaximized to prevent window from returning to normal size.
Please follow below for the code
Option Explicit Sub ActivatingFullScreen() 'Activating full screen Application.DisplayFullScreen = True End Sub 'Enter below code in ThisWorkbook module Private Sub Workbook_WindowResize(ByVal Wn As Window) 'Changing window state to maximum size Wn.WindowState = xlMaximized Application.DisplayFullScreen = True End Sub
If you liked this blog, share it with your friends on Facebook. Also, you can follow us on Twitter and Facebook.
We would love to hear from you, do let us know how we can improve our work and make it better for you. Write to us at info@exceltip.com
The applications/code on this site are distributed as is and without warranties or liability. In no event shall the owner of the copyrights, or the authors of the applications/code be liable for any loss of profit, any problems or any damage resulting from the use or evaluation of the applications/code.
didn't work office 2007
Hello! I am making a data entry form which I want to remove the "excel" look. The methods posted here works well, but the" restore down button" also restores the ribbon. Any ideas how to stop this?
Hi KPW,
We have worked on your requirement, and have included below VBA code for you.
To apply code, follow below steps..
1. Open any excel file
2. Press ALT + F11
3. Click on "ThisWorkbook" module in the VBA project and past the above code.
Please do let us know if you face any problem.
Happy Learning!
Site Admin
P.S. Login at www.excelforum.com to get instant solution for your simple and complicated queries.
Unfortunately if the Windows Toolbar is set to always be on top, which it usually is, part of the excel spreadsheet is obscured. Does anyone have a solution to this problem?
By Windows Toolbar are you referring to the task bar? If so put it at the bottom where it normally goes. I use the technique suggested in this post, myself to give my dashboards a non-Excel look.
You need to put vba in the Workbook module however to change the settings both when you close the workbook, and when you switch focus to another workbook.
For example:
Private Sub Workbook_Deactivate()
'Macro Purpose: Restores users prior scroll bar settings
With ActiveWindow
.DisplayHorizontalScrollBar = True
.DisplayVerticalScrollBar = True
End With
Application.DisplayFullScreen = False
Application.CommandBars("Full Screen").Visible = True
Application.DisplayFormulaBar = True
End Sub
So just reverse them at the end of the code, e.g. Application.DisplayFullScreen = False
This code exceed expectations, but the only problem is that is will change the view of the file menu for all other documents because it doesn't unload.