Excel VBA, error 438 "objeto no es compatible con esta propiedad o método
Tengo este código en el que he estado recibiendo ayuda un poco, pero me he encontrado con un problema, o lo que creo que es un problema. En la última búsqueda, se me dice que el objeto no admite esta propiedad o método. Sé que es probablemente algo fácil, pero mi cerebro está ardiendo. Me gustaría algo de ayuda si alguien sabe la respuesta de por qué sucede esto.
Gracias.
Option Explicit
Sub Update_Dakota()
Dim wsDAO As Worksheet 'Dakota OOR
Dim wsDAD As Worksheet 'Dakota Data
Dim wsDAR As Worksheet 'Dakota Archive
Dim wsPOR As Workbook 'New Workbook
Dim lastrow As Long, fstcell As Long
Dim strFile As String, NewFileType As String, filename As String
Set wsDAO = Sheets("Dakota OOR")
Set wsDAD = Sheets("Dakota Data")
Set wsDAR = Sheets("Dakota Archive")
With Application
.ScreenUpdating = False
.DisplayAlerts = False
.EnableEvents = False
End With
lastrow = wsDAD.Range("B" & Rows.Count).End(xlUp).Row + 1
With wsDAD
.Range("I2").Formula = "=COUNTIFS('Dakota OOR'!$B:$B,$A2,'Dakota OOR'!$D:$D,$C2, 'Dakota OOR'!$G:$G,$F2)"
.Range("J2").Formula = "=IF(I2,""Same"",""Different"")"
wsDAD.Range("I2:J2").Copy wsDAD.Range("I3:J" & lastrow)
wsDAD.Range("I:J").Calculate
End With
strFile = Application.GetOpenFilename()
NewFileType = "Excel Files 2007 (*.xls)"
Set wsPOR = Application.Workbooks.Open(strFile)
lastrow = wsPOR.Range("A" & Rows.Count).End(xlUp).Row + 1
wsPOR.Range("A2:G" & lastrow).Select
End Sub