I'm trying to save a workbook in my VBA procedure but it returns a Run-time error 9 (Subscript out of range) when it interprets the Set workbook line.
Why is this ? My workbook exists. Does it have to be open first, before saving ?
Here's my code.
Dim wbMaster As Workbook
Dim strFileName As String
strFileName = "Master.xlsx"
Set wbMaster = Workbooks(strFileName)
Application.DisplayAlerts = False
Application.EnableEvents = False
Application.EnableEvents = True
Application.DisplayAlerts = True
I get the error on the "Set wbMaster..." line.