Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro-file could not be found

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!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2,722
Default macro-file could not be found

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!*


"puiuluipui" wrote:

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!

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 468
Default macro-file could not be found

Perfect!
Thanks!

"Luke M" wrote:

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!*


"puiuluipui" wrote:

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!

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to copy value from 2nd file, if a word found in a correspondingrow of both files [email protected] Excel Discussion (Misc queries) 5 September 2nd 08 10:51 PM
Macro cannot be found, but it is there? bwilk77 Excel Discussion (Misc queries) 2 April 13th 07 05:56 PM
Macro cannot be found Barney Excel Discussion (Misc queries) 2 April 4th 06 01:21 PM
File Not Found menu pops up after I open a file Harveytunes Excel Discussion (Misc queries) 3 January 27th 06 07:23 PM
How do I reference external data from a file, file name found in . Clux Excel Discussion (Misc queries) 1 February 10th 05 10:52 PM


All times are GMT +1. The time now is 05:39 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"