Consulting

Results 1 to 2 of 2

Thread: Keeping active workbook open

  1. #1

    Keeping active workbook open

    Hi,
    I am new to Excel VBA code. I have run into an issue and was looking to see if I could get some help. I have done quite a bit of searching online to no avail.

    I have an excel spreadsheet that I have placed a command button on. When this command button is clicked, it takes me to another excel workbook and the operator will complete his checks and submit. The problem I am running into is that my original excel file must remain open after completing the operator checks. Is there a way to keep the original workbook open?

    Current command button code is below.

    Private Sub CommandButton1_Click()

    Workbooks.Open Filename:= _
    "F:\file location.xlsm"


    End Sub

  2. #2
    VBAX Expert Leith Ross's Avatar
    Joined
    Oct 2012
    Location
    San Francisco, California
    Posts
    552
    Location
    Hello King Rodder,

    You can open the new workbook in another instance of Excel like this...

    Sub TestIt()
    
    
        Dim x As Variant
        
            x = Shell("Excel.exe /e ""F:\file location.xlsm""", 3)
            
    End Sub
    Sincerely,
    Leith Ross

    "1N73LL1G3NC3 15 7H3 4B1L17Y 70 4D4P7 70 CH4NG3 - 573PH3N H4WK1NG"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •