I have 3 command buttons on a userform. When the user selects command button 3, for example, it will perform the following code below assigned to it.
Code:
Private Sub CommandButton3_Click()
Workbooks.Open Filename:="C:\........\........\Documents\filename.xlsm"
End Sub
Once this file opens, it displays another userform. However, the first userform is still opened in the background. How do I close that userform before it opens the new one?
I tried to include this code directly after the one above but it didn't work.
Code:
Workbooks("C:\....\.....\Documents\filename.xlsm").Close
I even tried: Workbooks("filename.xlsm").close
Didn't work. Both instances still left it opened in the background.
Thanks.