G
Gazza
I have a simple save routine which saves the file to my own c drive and then
a copy to a network drive. How can I run the sproceedure and trap the error
if the pc is not connected to the network.
Also would it be possible to trap another error - say if the file had been
opened by someone using the network drive copy, to ignore the second part of
the routine too and perhaps send a message back to the user that it has been
saved to the local drive but not the network.
Sub SaveOptions()
'
' SaveOptions Macro
' Macro recorded 25/09/2006 by Gary Mallin
'Save to own hard-drive
ChDir "C:\Documents and Settings\malling\My Documents\Gary's Documents"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\malling\My Documents\Gary's
Documents\TOIL 2006-2007 Gary.xls" _
, FileFormat:=xlNormal, Password:="gazzaflexi", WriteResPassword:=
_
"", ReadOnlyRecommended:=False, CreateBackup:=False
'Save to Network Drive
ChDir "Z:\man ac\Preston06-07\TOIL"
ActiveWorkbook.SaveAs Filename:= _
"Z:\man ac\Preston06-07\TOIL\TOIL 2006-2007 Gary.xls",
FileFormat:=xlNormal, _
Password:="gazzaflexi", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
As always help from this forum greatly appreciated
Gaz
a copy to a network drive. How can I run the sproceedure and trap the error
if the pc is not connected to the network.
Also would it be possible to trap another error - say if the file had been
opened by someone using the network drive copy, to ignore the second part of
the routine too and perhaps send a message back to the user that it has been
saved to the local drive but not the network.
Sub SaveOptions()
'
' SaveOptions Macro
' Macro recorded 25/09/2006 by Gary Mallin
'Save to own hard-drive
ChDir "C:\Documents and Settings\malling\My Documents\Gary's Documents"
ActiveWorkbook.SaveAs Filename:= _
"C:\Documents and Settings\malling\My Documents\Gary's
Documents\TOIL 2006-2007 Gary.xls" _
, FileFormat:=xlNormal, Password:="gazzaflexi", WriteResPassword:=
_
"", ReadOnlyRecommended:=False, CreateBackup:=False
'Save to Network Drive
ChDir "Z:\man ac\Preston06-07\TOIL"
ActiveWorkbook.SaveAs Filename:= _
"Z:\man ac\Preston06-07\TOIL\TOIL 2006-2007 Gary.xls",
FileFormat:=xlNormal, _
Password:="gazzaflexi", WriteResPassword:="", _
ReadOnlyRecommended:=False, CreateBackup:=False
End Sub
As always help from this forum greatly appreciated
Gaz