Saving in two folders

nuge725

New Member
Joined
Jun 16, 2011
Messages
21
Hey everybody,

I am hoping that someone can help me out here. I have the basic concept down, I think this just needs some tweaking, in order to work. What I am trying to do is have a file save to two different folders, essentially creating a continual and self-sustaining backup folder, in the event that files are deleted off of one folder. Anyway, here is the code that I am using, which is in a module:

Code:
Sub Savingtwofolders()
   chDir1 = "O:\Test Folder A"
   chDir2 = "O:\Test Folder B"
   Filename = "file1.xls"
   ActiveWorkbook.SaveAs Filename:=chDir1 + Filename
   ActiveWorkbook.SaveAs Filename:=chDir2 + Filename
End Sub

The problem I am having is that it will save in the first folder, but not the second (although it does prompt with the file already exists message, it is not seen in the folder). However, I also keep getting the debugger message, which highlights the "ActiveWorkbook.SaveAs Filename:=chDir2 + Filename" line. Any help is greatly appreciated.

Thanks in advance,

Nuge
 

Excel Facts

Select all contiguous cells
Pressing Ctrl+* (asterisk) will select the "current region" - all contiguous cells in all directions.
Code:
Sub Savingtwofolders()
   chDir1 = "O:\Test Folder A[COLOR="Red"]\[/COLOR]"
   chDir2 = "O:\Test Folder B[COLOR="Red"]\[/COLOR]"
   Filename = "file1.xls"
   ActiveWorkbook.SaveAs Filename:=chDir1 [COLOR="Red"]&[/COLOR] Filename
   ActiveWorkbook.SaveAs Filename:=chDir2 [COLOR="Red"]&[/COLOR] Filename
End Sub
 
Upvote 0

Forum statistics

Threads
1,223,171
Messages
6,170,478
Members
452,332
Latest member
The2ndQuest

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top