Don't have an explanation or solution.
But if you put the lines
Set Cell = ws.Cells(2,1)
Cell.Value = "=hyperlink("C:\Temp.xlsx";"link")"
in your code (and omit the nested loops which throws the error) you get a more meaningful (??) error - at least its not the unknown error.