PDA

View Full Version : Keeping active workbook open



King Rodder
06-13-2017, 01:27 PM
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

Leith Ross
06-13-2017, 01:46 PM
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