BewilderedSoul
New Member
- Joined
- Apr 22, 2011
- Messages
- 6
I am using the following code to prompt user to select the file that they want to open. How to prevent error message from showing when user press cancel on the open file dialog?
Code:
sub openfile()
Dim namefile as String
namefile = Application.GetOpenFilename
Workbooks.Open namefile
end sub