Hi! I have the below, which allows the user to open the designated file and then run my macro accordingly. I noticed that if that file is already open it doesnt run the rest of the macro properly, so it there a way to say if that file is already open, close the already open file, and then open the file in question to perform the macro?
VBA Code:
Set macroWB = ActiveWorkbook
NewFFN = Application.GetOpenFilename(Title:="Please Select File")
If NewFFN = False Then
MsgBox "Macro Terminated Due to No File Selected"
Exit Sub
Else
Workbooks.Open fileName:=NewFFN
Set fileWB = ActiveWorkbook
End If
Application.Calculation = xlCalculationAutomatic '<- may not be necessary