I\'m trying to open the UserForm1 of an excel macro through batch file. I\'m able to open that but excel is also getting opened along with that. I want only UserForm1 to be
You need to show the UserForm
in modeless
mode and then hide the application.
try this
Sub open_form()
Application.Visible = False
UserForm1.Show vbModeless
End Sub
and either in a button you need to set it back to true or you can use the UserForm_QueryClose
event
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Application.Visible = True
ThisWorkbook.Close SaveChanges:=False
End Sub