I have a Sub that I pass a Workbook to:
To call the Sub, I'm using:
Reprint Workbooks(StrRunNum & ".xls")
Every time my code gets to that line, though, it throws a
Subscript out of range error
Any idea what I need to change?
Thanks
Code:
Sub Reprint(WB As Workbook)
On Error GoTo ERRREPRINT
If WB.Sheets("DATA").Range("Z1") = 1 Then
'clear the detail section, in case there's old data in there
ClearRptDtl
'calculate and build detail section of report
BuildRptDtl
'print the report
PrintRpt
End If
Exit Sub
ERRREPRINT:
LogError Error, "REPRINT"
Exit Sub
End Sub
To call the Sub, I'm using:
Reprint Workbooks(StrRunNum & ".xls")
Every time my code gets to that line, though, it throws a
Subscript out of range error
Any idea what I need to change?
Thanks