1

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

  • Possible duplicate of [Hiding active workbook programmatically in Excel](http://stackoverflow.com/questions/11354456/hiding-active-workbook-programmatically-in-excel) – Luuklag May 02 '17 at 06:53
  • Thank you for the comment Luuklag, although i want to hide the excel Application and when i open any other other excel workbook i want to make the application visible and hide the specific "database" workbook. The question you linked as duplicate is not relevant. – Raphael Yaghdjian May 02 '17 at 08:25

0 Answers0