我的代碼如下所示是一個「object required error」。你能幫我理解什麼是錯的嗎?「對象需要的錯誤」是什麼意思?
Private Sub Command9_Click()
Dim sPath As String
Dim sFil As String
Dim strName As String
Dim twbk As Workbook
Dim owbk As Workbook
Dim ws As Worksheet
Set twbk = ActiveWorkbook
sPath = "C:\Adise\Export\" 'Change to suit
sFil = Dir(sPath & "*.xls")
Do While sFil <> ""
strName = sPath & sFil
Set owbk = Workbooks.Open(strName)
Set ws = owbk.Sheets(1)
ws.Range("A1", Range("A" & Row.Count).End(xlUp)).Copy
twbk.Sheets(1).Range("A65536").End(xlUp)(2).PasteSpecial xlPasteValues
owbk.Close False 'Close no save
sFil = Dir
Loop
twbk.Save
End Sub
雖然這不是最清楚的問題,但它確實包含代碼,它確實列出了標題中的錯誤 - 它確實得到了兩個答案,這似乎與「不是真正的問題」分類相矛盾。而不是關閉,我會要求提供錯誤信息,儘管它很清楚它是哪一個。所以我投票重新開放。 – 2013-03-10 15:10:05