Application.visible = false does not work anymore

ekimsnilloc87

New Member
Joined
Mar 21, 2019
Messages
1
Hey guys, this is my first post here, and i made an account to get help from the experts!

I have a self contained calculator that is a userform which does not require a visible workbook to operate.

So, in my Workbook Open sub, i have:

Application.Visible = False
UserForm1.Show

and this used to work to make the UserForm open automatically and hide the excel window, but now it doesn't work. If I open the workbook by double clicking it, then the userform will open but the spreadsheet window will be behind it.

If I open Excel, and then go to File:Open, to open it, then the userform opens by itself and the spreadsheet window is hidden.

I am not sure why this would be different depending on how the file is opened, so any insight would help!

Thank you!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
.
Pate in ThisWorkbook module :


Code:
Option Explicit


Private Sub Workbook_BeforeClose(Cancel As Boolean)
     ThisWorkbook.Application.WindowState = xlNormal
     ThisWorkbook.Application.Visible = True
End Sub


Private Sub Workbook_Open()
    FormOnly
End Sub



Paste in regular module :

Option Explicit


Sub FormOnly()
Application.WindowState = xlMinimized
UserForm1.Show
End Sub
Code:



Paste in the UserForm1 :


Code:
Option Explicit


Private Sub CommandButton1_Click()
UserForm1.Hide
    Application.ScreenUpdating = False
    ThisWorkbook.Application.Visible = False
    ThisWorkbook.Application.WindowState = xlMinimized
    Workbooks("Open UserForm Only.xlsm").Close     '<---- change name of workbook here
    Application.ScreenUpdating = True
End Sub


If you don't want the workbook to be seen when loading ... as far as I know, that cannot be done. BUT ... after opening
this workbook, shrink the margins of the workbook down to a small square. Then, each time you open the workbook after that,
it will appear on the screen just momentarily as a small square then drop to the Task Bar and the UserForm will be visualized.
 
Upvote 0

Forum statistics

Threads
1,224,875
Messages
6,181,516
Members
453,050
Latest member
Obil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top