Hi everyone,
Im having a hard time with this and I really expect you to help me please.

I have a form with a button, that button shows another form with another button, without hiding the previous form. Everything works fine so far. So in the second form, i've got the button so when you click it, it creates a new workbook. I've got the application to be hidden, this means that when you run the application, it opens just the forms, you can't see the worksheets nor the workbook.

Private Sub Workbook_Open()
    Application.Visible = False
    On Error Resume Next
    UserForm1.Show
End Sub

Private Sub Workbook_WindowActivate(ByVal Wn As Window)
    UserForm1.Show
End Sub

Private Sub Workbook_WindowDeactivate(ByVal Wn As Window)
    UserForm1.Hide
End Sub
When I click on the button to create a new workbook, it creates the new workbook BUT it takes "control" of the application. This means that if I want to close this new created workbook, the application closes too. I don't want this to happen.
Here's the code of the button:


Private Sub CommandButton1_Click()
    Dim wb As Workbook
    
    Application.ScreenUpdating = False
    Set wb = Workbooks.Add
    Dim strFilename As String: strFilename = "C:\Users\vargasvo\PruebaSave"
    wb.SaveAs Filename:=strFilename, FileFormat:=xlOpenXMLWorkbook
    Application.ScreenUpdating = True
    Unload Me
    
End Sub
BUUUUUUUUUUUUUUUUUUUUT if I make visible the application (make workbook appear changing Application.Visible = True), it works fine, if I close the new workbook, the application doesnt close. That's what I need,

I NEED TO OPEN THE APPLICATION WITHOUT SHOWING THE APP'S WORKBOOK, CREATE A NEW WORKBOOK, BEING CAPABLE TO SAVE OR DO WHATEVER I WANT WITH THIS NEW WORKBOOK (EVEN CLOSING IT) WITHOUT HARMING THE APPLICATION.


Things to make clear:
  • ShowModal on both formularies are FALSE
  • Im not hiding the first form
  • When I create the workbook, I want to close that second form that creates the workbook and return to the first one automatically

I'm expecting to have other option rather than always showing the workbook of the app, that wouldn't be aesthetic.
Thanks for your help