Alphacsulb
Active Member
- Joined
- Mar 20, 2008
- Messages
- 414
When the file name doesn't exist then I get a run time error 1004. Which I know means that the file doesn't exist. However, I want to show/create a userform that tells other people using this worksheet the reason why it didn't work so that they can correct it themselves instead of asking me every time.
This is the code that looks for the file name in I2, in the folder Reports
What I would like to do is add the following:
IF the file does not exist (creates the run time error 1004) then
ReasonForError.Show
Exit Sub
Would this go in front or before my current piece of code?
This is the code that looks for the file name in I2, in the folder Reports
Code:
ChDir "M:\Reports" 'Where to start looking in
Workbooks.Open Filename:="M:\Reports\" & ActiveSheet.Range("I2") ' Opens the Billing file, the file name is in I2
What I would like to do is add the following:
IF the file does not exist (creates the run time error 1004) then
ReasonForError.Show
Exit Sub
Would this go in front or before my current piece of code?