Sevreral issues here:
- The Destination Workbook may or may not be open. If it’s not, open it
- The Destination Workbook may or may not have a sheet called “TAC data”.
- wsDest is a Worksheet, not a Workbook, so you need specify a Worksheet (as in your comment)
- When referencing an open Workbook, only specify the book name, without the path
Dim fPath as String
'...
fPath = "C:\TACs\"
fName = "ResumoTACs_" & Format(Date, "MM-YYYY") & ".xlsx"
fExists = Dir(fPath & fName)
'...
If fExists = "" Then
'...
Else
On Error Resume Next
Set wbDest = Workbooks(fName) ' now that fName contains only the file name
On Error GoTo 0
If wbDest Is Nothing Then
'Open it
Set wbDest = Workbooks.Open(fPath & fName)
End If
End If
'...
On Error Resume Nest
Set wsDest = wbDest.Worksheets("TAC data")
On Error GoTo 0
If wsDest Is Nothing Then
' Sheet missing. What now?
Else
'...
CLICK HERE to find out more related problems solutions.