0
我不知道爲什麼這會造成運行時錯誤。它應該選擇工作簿1中的工作表將其複製到工作簿2中。任何人都可以幫助我嗎? 調試顯示錯誤是在該行:「ActiveWorkbook.Sheets.Select」運行時錯誤1004:對象'表'的方法'選擇'失敗
Private Sub CommandButton1_Click()
'On Error GoTo ErrorHandler
If cef.path = "" Then
MsgBox ("PATH of pictures is required")
Else
Dim WB1 As Workbook
Dim WB2 As Workbook
Dim num As Double
Set WB1 = ActiveWorkbook
ActiveWorkbook.Sheets("Item_number").Visible = True
ActiveWorkbook.Sheets("CODES").Visible = True
ActiveWorkbook.Sheets("Item_Number_Hydro").Visible = True
ActiveWorkbook.Sheets.Select
ActiveWindow.SelectedSheets.Copy
Set WB2 = ActiveWorkbook
Dim nombreHoja As String
@DavidSemens我怎麼能給予好評的編輯? :P –