Barbaaz
Barbaaz

Reputation: 105

Keep Excel always minimized

I have an Excel file with some macros and userforms.

I don't want the users to have access to the file itself without a password. They should only be able to see the userform and input data through the userform.

This is the code I have at the moment.

Private Sub Workbook_Open()

Dim ws As Worksheet
     For Each ws In Worksheets
          ws.Protect "Password", UserInterfaceOnly:=True 'True allows code to change data.
     Next ws

Application.WindowState = xlMinimized
UserForm4.Show vbModeless

End Sub

Whenever we need to use another program or application, it minimizes Excel, but when try to use Excel again, the window is maximized.

Is it possible to keep Excel minimized at all times?

Upvotes: 1

Views: 884

Answers (1)

Storax
Storax

Reputation: 12167

Instead of minimizing you could hide the application.

Application.Visible = False
UserForm4.Show vbModeless

In this way you will only see the userform but you have to make sure you reset this setting when you leave the userform.

Upvotes: 3

Related Questions