ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   macro to save to network (https://www.excelbanter.com/excel-programming/337956-macro-save-network.html)

jim hardwick[_2_]

macro to save to network
 
hello,

I have a problem saving and excel workbook. I want the workbook to save to
several network locations without prompting to replace which I have done as
per below;

Application.DisplayAlerts = False

ActiveWorkbook.SaveAs Filename:= _
"\\Stevebrant\SharedDocs\Draught.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

But if the networked computer is offline the macro fails - can I get the
macro to only save if the computer is turned on or to continue regardless?

Help me please!!

Tom Ogilvy

macro to save to network
 
Did you try

On Error Resume Next
Application.DisplayAlerts = False

ActiveWorkbook.SaveAs Filename:= _
"\\Stevebrant\SharedDocs\Draught.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True
On Error goto 0

--
Regards,
Tom Ogilvy


"jim hardwick" wrote in message
...
hello,

I have a problem saving and excel workbook. I want the workbook to save to
several network locations without prompting to replace which I have done

as
per below;

Application.DisplayAlerts = False

ActiveWorkbook.SaveAs Filename:= _
"\\Stevebrant\SharedDocs\Draught.xls" _
, FileFormat:=xlNormal, Password:="", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False

But if the networked computer is offline the macro fails - can I get the
macro to only save if the computer is turned on or to continue regardless?

Help me please!!





All times are GMT +1. The time now is 01:15 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com