ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   request macro to save file to multiple, separate locations (https://www.excelbanter.com/excel-programming/328162-request-macro-save-file-multiple-separate-locations.html)

Joseph Spain

request macro to save file to multiple, separate locations
 
Hi,

I would like to request a macro that can do the following tasks:

1. check to see if three specific network paths are available
2. save to all of the network paths that are available, without
generating errors (or messages) for the paths that are not available

Any ideas? Hopefully, someone already has written such a macro.

As always, thanks very much for your assistance and suggestions

Best regards,
Joseph




Vasant Nanavati

request macro to save file to multiple, separate locations
 
Untested since I'm not networked right now:

Sub SaveToAllPaths(strPath1 As String, strPath2 As String, strPath3 As
String)
On Error Resume Next
With ThisWorkbook
.SaveAs strPath1 & "\" & .Name
.SaveAs strPath2 & "\" & .Name
.SaveAs strPath3 & "\" & .Name
End With
End Sub

--

Vasant

"Joseph Spain" wrote in
message news:8ygbe.5462$Bb.292@okepread06...
Hi,

I would like to request a macro that can do the following tasks:

1. check to see if three specific network paths are available
2. save to all of the network paths that are available, without
generating errors (or messages) for the paths that are not available

Any ideas? Hopefully, someone already has written such a macro.

As always, thanks very much for your assistance and suggestions

Best regards,
Joseph






Joseph Spain

request macro to save file to multiple, separate locations
 
"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote:

Untested since I'm not networked right now:

Sub SaveToAllPaths(strPath1 As String, strPath2 As String, strPath3 As
String)
On Error Resume Next
With ThisWorkbook
.SaveAs strPath1 & "\" & .Name
.SaveAs strPath2 & "\" & .Name
.SaveAs strPath3 & "\" & .Name
End With
End Sub

--

Vasant


Thanks much. I modified your idea slightly, and it works flawlessly.
Good work.

Best regards,
Joseph



Dave Peterson[_5_]

request macro to save file to multiple, separate locations
 
You may want to look at SaveCopyAs in VBA's help for another alternative.



Joseph Spain wrote:

"Vasant Nanavati" <vasantn *AT* aol *DOT* com wrote:

Untested since I'm not networked right now:

Sub SaveToAllPaths(strPath1 As String, strPath2 As String, strPath3 As
String)
On Error Resume Next
With ThisWorkbook
.SaveAs strPath1 & "\" & .Name
.SaveAs strPath2 & "\" & .Name
.SaveAs strPath3 & "\" & .Name
End With
End Sub

--

Vasant


Thanks much. I modified your idea slightly, and it works flawlessly.
Good work.

Best regards,
Joseph


--

Dave Peterson


All times are GMT +1. The time now is 02:46 PM.

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