Similar to the problem

here, I receive an automation error, when using this code, the debugger is marking the line with n =...

Quelldatei = Cells(22, 4).Value
Quelldatei2 = Cells(35, 4).Value
Set WB = Workbooks.Open(Quelldatei)
Set WB2 = Workbooks.Open(Quelldatei2)
    
n = WB.Worksheets(1).Cells(Rows.count, 1).End(xlUp).Row
m = WB2.Worksheets(1).Cells(Rows.count, 1).End(xlUp).Row
Would be great if someone can help!