Guys,
I have this code ....
filename = InputBox("Please enter a filename", "Export Filename") & ".xls"
However, if the user hits cancel my code still continues. How can I only capture the string if the user hits OK and the string is not blank ?
Bob
Printable View
Guys,
I have this code ....
filename = InputBox("Please enter a filename", "Export Filename") & ".xls"
However, if the user hits cancel my code still continues. How can I only capture the string if the user hits OK and the string is not blank ?
Bob
if the user hits cancel the string returned should be blank
VB Code:
dim returned As String = InputBox("Please enter a filename", "Export Filename") if not returned Is Nothing AndAlso returned.length > 0 Then filename = returned & ".xls" End If
Thanks Phil.
Bob
Wouldn't you want to use a SaveFileDialog to get the file name, or are you just giving them the choice of file name but not folder location?