save document to another file when target file is unavailable

A

Anonymous

Hello,

I have written a macro to save documents to several destinations over
a network.
When the network connection fails or I'm not linked to it the macro
crashed with out saving.
Is there some script that would detect the fact that the destination
file is not available and save into another available file

thanks very much
 
J

Jezebel

Dim pSuccess as boolean

On error resume next
MyDoc.SaveAs FileName:=....
pSuccess = (Err.Number = 0)
On error goto 0

If not pSuccess then
... save failed so do something else
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top