To make sure that the user has chosen the OK button, check that the input box hasn't returned a zero-length string
Sub res()
Dim strWhichOffice
strWhichOffice = InputBox("Enter the name of the office:", _
"Expense Assistant 2000", "default", , , _
"c:\Help.chm", 0)
If strWhichOffice = "" Then End
End Sub
Related examples in the same category