標題: [發問] 關於 on error resume next [打印本頁] 作者: feecshyrnd 時間: 2015-11-20 01:11 標題: 關於 on error resume next
On Error Resume Next '遇錯誤要繼續執行
Reset:
x = InputBox("請輸入預瀏覽之排程日期", , "請輸入日期 <例如 1007 1010 >")
ActiveWorkbook.FollowHyperlink "http://zipsum/fileupload/LCD6RPT/01.前排程相關資訊/00.LCD6%20前段排程%20Watch%20This%20!!/201510/LCD6%20生產排程%20與%20Watch%20This" & x & "前排版.xls"
If Err.Number <> 0 Then '若前面有發生錯誤
result = MsgBox(prompt:=Err.Description & vbCrLf & vbCrLf & "要繼續執行嗎?", _
Buttons:=vbYesNo, Title:="發生錯誤", HelpFile:=Err.HelpFile, Context:=Err.HelpContext)
GoTo Reset
If Not result = vbYes Then Exit Sub '若按 "否" 就結束
End If
End Sub