我正在尝试检查一个工作表是否与另一个工作表相同。下面的示例显示了我是如何做到的。
Dim sheet1 as Worksheet, sheet2 as Worksheet
Set sheet1 = GetObject("C:\sheet1.xls").Worksheets(1)
Set sheet2 = GetObject("C:\sheet2.xls").Worksheets(1)
If sheet1 = sheet2 Then Debug.Print("Same workbook") 'Should of course return false, but instead gives an error
但这给出了错误Object doesn't support this property or method
。那么如何比较像这样的两张纸呢?