S
Steve
I'm using Office 2000 and 2003.
Following is an extraction of the code I'm using. The issue is when
"If ((Answer = vbCancel) Or (Answer = "") Or (Answer = "X")) Then Call
ConfirmExit" is executed in GetSaveFilename subroutine and Answer does = "X"
the ConfirmExit subroutine is never called and control immediately returns to
the MainCapture procedure. By chance is confirm or ConfirmExit reserved words
in VBA? I'm puzzled why this keeps happening and have wasted too much time on
what should be a very simple procedure. Any assistance would be greatly
appreciated.
Sub MainCapture()
Call GetSaveFilename
If exitproc Then Exit Sub
....
....
End Sub
Sub GetSaveFilename()
filename = ""
WindowTitle = "Get Filename"
Do
Answer = InputBox("Enter filename to save survey information." & vbCr & vbCr
& "Hit Enter, Cancel or type X or x to exit.", WindowTitle)
If Answer = "x" Then Answer = "X"
If ((Answer = vbCancel) Or (Answer = "") Or (Answer = "X")) Then Call
ConfirmExit
If exitproc Then Exit Sub
....
....
Loop
End Sub
Sub ConfirmExit()
exitproc = False
confirm = MsgBox("Select ""Yes"" to confirm termination" & vbCr & vbCr & _
"Select ""No"" to continue processing.", vbYesNo _
vbDefaultButton2, WindowTitle)
If confirm = vbYes Then exitproc = True
End Sub
Following is an extraction of the code I'm using. The issue is when
"If ((Answer = vbCancel) Or (Answer = "") Or (Answer = "X")) Then Call
ConfirmExit" is executed in GetSaveFilename subroutine and Answer does = "X"
the ConfirmExit subroutine is never called and control immediately returns to
the MainCapture procedure. By chance is confirm or ConfirmExit reserved words
in VBA? I'm puzzled why this keeps happening and have wasted too much time on
what should be a very simple procedure. Any assistance would be greatly
appreciated.
Sub MainCapture()
Call GetSaveFilename
If exitproc Then Exit Sub
....
....
End Sub
Sub GetSaveFilename()
filename = ""
WindowTitle = "Get Filename"
Do
Answer = InputBox("Enter filename to save survey information." & vbCr & vbCr
& "Hit Enter, Cancel or type X or x to exit.", WindowTitle)
If Answer = "x" Then Answer = "X"
If ((Answer = vbCancel) Or (Answer = "") Or (Answer = "X")) Then Call
ConfirmExit
If exitproc Then Exit Sub
....
....
Loop
End Sub
Sub ConfirmExit()
exitproc = False
confirm = MsgBox("Select ""Yes"" to confirm termination" & vbCr & vbCr & _
"Select ""No"" to continue processing.", vbYesNo _
vbDefaultButton2, WindowTitle)
If confirm = vbYes Then exitproc = True
End Sub