hey @user10792291 - I'm just looking at
your recent question on SO -- you'll want to edit it to include the actual error, and whether the
myFile
variable contains a legal existing file name. Side note, I'd recommend capturing the returned
Workbook
object into a local variable:
Set wb = Workbooks.Open(myFile)
, that way you can work with
wb
instead of working out which object in the
Workbooks
collection is the workbook that was just opened.