Hi,
I'm getting the "subscript out of range" error and I'm not sure what's causing it.
When I debug it, it stops at the following point:
This is the whole function, it basically gives me this error when I save the new exported document to my desktop. When I look at the "Table__2020_RevTM.accdb" qryRev table in Access it seems to show up fine and the data also shows up fine in the file that I'm running this macro from.
Does anyone have an idea of what could be causing this issue?
Thank you!
I'm getting the "subscript out of range" error and I'm not sure what's causing it.
When I debug it, it stops at the following point:
Code:
ActiveSheet.ListObjects("Table__2020_RevTM.accdb").Range.AutoFilter Field:=1
This is the whole function, it basically gives me this error when I save the new exported document to my desktop. When I look at the "Table__2020_RevTM.accdb" qryRev table in Access it seems to show up fine and the data also shows up fine in the file that I'm running this macro from.
Code:
Sub Export_Rep()
Application.ScreenUpdating = False
selRep = Range("selRep") ' set var of rep name
Qtr = Range("Qtr") ' set qtr
ConsQtr = Qtr & " Summary" ' set var of consolidated quarter
Call nwWorkbook(selRep, Qtr, ConsQtr)
Call Comm_Export(selRep, Qtr, ConsQtr)
Call Rev_Export(selRep, Qtr, ConsQtr)
Call TM_Export(selRep, Qtr, ConsQtr)
Call Export_SaveAs(selRep, Qtr, ConsQtr)
Sheets("Reps REV").Select
ActiveSheet.ListObjects("Table__2020_RevTM.accdb").Range.AutoFilter Field:=1
Sheets("Reps T&M").Select
ActiveSheet.ListObjects("Table__2020_RevTM.accdb28").Range.AutoFilter Field:=1
Sheets(1).Select
End Sub
Does anyone have an idea of what could be causing this issue?
Thank you!