macro-file could not be found

  • Thread starter Thread starter puiuluipui
  • Start date Start date
P

puiuluipui

I haved a macro that copy information from a closed workbook. If the macro
doesn't find the closed workboo, i receive an error '1004': file......could
not be found.
Is there an code to avoid this error? Or, better...if there is an code that
will display, instead of '1004' error, a message: "there is no entry for this
day".
Can this be done?
Thanks!
 
Perhaps something like:

Test = Dir("C:\Some File Path\Workbook.xls")
If Test = "" then
msgbox "There is no entry for this day"
exit sub
end if
 
Perfect!
Thanks!

Luke M said:
Perhaps something like:

Test = Dir("C:\Some File Path\Workbook.xls")
If Test = "" then
msgbox "There is no entry for this day"
exit sub
end if

--
Best Regards,

Luke M
*Remember to click "yes" if this post helped you!*
 
Back
Top