View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Error 1004 help needed

The file is probably not avvailable either bacuase of backups or a network
drive may be off-line. You probably need to put in an On Error sttatement
that waits 30 minutes and then tries again.

"sb1920alk" wrote:

I'm very close to having this fixed. I need a little bit of help on the last
part.

I have a file on a loop that opens another file, does a bunch of stuff, then
closes the other file. Then everything repeats. This runs 24 hours a day and
goes for days and days and works fine, then for no reason it gives: method
open of objects workbooks failed. All I can find is that this error means the
file I'm trying to open is corrupted, but I know this is not the case because
the file that is opening a closing again and again is not being saved, so
there are no changes. Additionally, to get things going agian, I just end the
debugger and open the first file again. That's it. But I want this to happen
on it's own.

All I need is an error handling code that will do this for me. One option
that would solve my problem would be two steps. On error:
1) Excel exists completely without saving changes on any open files.
2) Workbook Star1 opens