Hello,
The following code for a UserForm command button causes an error message(number 0)-which really resets the error check, even when the intended action performs flawlessly. I tooks steps to override in the err_OpenFile: section. I cannot determine what the cause is. Perhaps a better Open method?
Thanks........Mick
Private Sub cmdOpenFile_Click()
On Error GoTo err_OpenFile
Dim strFilePath As String
strFilePath = txtXLS.Value
Application.Workbooks.Open (strFilePath)
Unload Me
err_OpenFile:
If Err.Number = 0 Then
Exit Sub
Else: MsgBox Err.Description & " Error #" & Err.Number
End If
Exit Sub
End Sub
The following code for a UserForm command button causes an error message(number 0)-which really resets the error check, even when the intended action performs flawlessly. I tooks steps to override in the err_OpenFile: section. I cannot determine what the cause is. Perhaps a better Open method?
Thanks........Mick
Private Sub cmdOpenFile_Click()
On Error GoTo err_OpenFile
Dim strFilePath As String
strFilePath = txtXLS.Value
Application.Workbooks.Open (strFilePath)
Unload Me
err_OpenFile:
If Err.Number = 0 Then
Exit Sub
Else: MsgBox Err.Description & " Error #" & Err.Number
End If
Exit Sub
End Sub