Will THis work properly? If not, how do I get the code to gracefully exit when Cancel is selected?
As it stands, if "Cancel" is selected, then the default Directory is outputted to the worksheet
As it stands, if "Cancel" is selected, then the default Directory is outputted to the worksheet
Code:
Dim file_name As String
file_name = Dir(InputBox("My Data Files - .html Web Reports files", "DIRECTORY", "C:\Data\*.htm"))
If returnvalue = 6 Then 'USer Chooses Yes
Application.Run"MyMacro"
Else
ActiveSheet.Delete
Exit Sub
End If