I am developing a Excel VBA Database and Managing System and I would like to hide the excel application while the database is running (only showing the Userforms), and whether I open another excel files it makes the application visible again.
First I used:
Sub workbook_open()
Application.Visible = False
End sub
Sub Workbook_beforeclose(Cancel as Boolean)
Application.visible = True
End sub
The problem with this is that when I have this specific program/database running it will unable me from simultaneously using excel for other files if I want.
I tried to come up with a solution which would be:
Sub Workbook_Open()
If Workbooks.count > 1 then
Application.visible = true
Application.windows("mydatabase.xlsm").visible = false
Else
Application.Visible = False
Application.ScreenUpdating = False
SplashUserForm.Show (vbModeless)
End If
With this I thought of making the application visible and the specific workbook (mydatabase) invisible, and once others workbook close if there is only the specific workbook open (mydatabase) it would go back to application.visible = false.
This was the solution I found, but I am having problems in executing this code, as once it opens a second workbook (random excel file) it makes the application visible again but doesn't make the specific workbook (mydatabase) invisible.
Someone would know how I could execute this code ? or an alternative solution for my problem ?
And the reason I want to hide the excel workbook is to make it look as a standalone program, with its own interface and have a more unique feel to it rather than having a workbook or excel interface in the background.
Thank you very much