Normally when we double click excel file icon it will automatically open your file but this time we wanted to show User form only where excel file will be call when necessary. In order to do this we can use function below:
ThisWorkbook.Application.Visible = False Or set to True.
What we do is to set the file visible is False when we open excel the file and when click button at userform to show then we set visible is True.
The example as below:
2 things we must do
1) Under This Work Book Module insert below code:
Private Sub Workbook_Open() ThisWorkbook.Application.Visible = False UserForm1.Show End Sub
2) Now create one user form (of course default will be UserForm1 with button. Double click this button and insert below code:
Private Sub CommandButton1_Click() ThisWorkbook.Application.Visible = True UserForm1.Hide End Sub
Now save this file close. When we open this file we will see userform with button. When we click this button this form disappear and excel file is open.
If you have any question or project please e-mail to me, I will reply and create for free.
Click Here to E-mail