Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a workbook that I constantly update with web queries throughout the
day. This is on my pc at work on my C:\ drive. I also keep a copy on a public network drive so co-workers can see the latest & greatest updates. What I want to do is whenever I save the book it will save to both places. Since I rarely close this book throughout the week, I just do saves after each update, I stayed away from the Before_Close event, and went with the Before_Save event. My code will save to the network drive, but crashes Excel at the end of the procedure, and therefore does not save to the local drive. I thought perhaps because I was saving the file with the same name in 2 places, it crashed because of duplicate file names. So I added "Copy of" to the name of the network file, but still no cookie. It still crashes. Can anybody point me in the right direction so when I click the Save (Disk) icon, it will save to both drives? I put the CurDir check in the code so that the network copy would not also run the code in case someone tried to save that file. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim CrDr As String CrDr = CurDir If CurDir = "C:\My Documents" Then ChDir "\\Lafbdc1\dept\NCP" Application.EnableEvents = False ActiveWorkbook.SaveAs "\\Lafbdc1\dept\NCP\Copy of NCP Work.xls" ChDir CrDr End If Application.EnableEvents = True End Sub Mike F |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Saving a workbook in two places. | Excel Discussion (Misc queries) | |||
Shared workbook - to save or not to save | Excel Discussion (Misc queries) | |||
Select sheet tabs in workbook & save to separate workbook files | Excel Worksheet Functions | |||
Macro needed; save a file two (or more places) at the same time | Excel Programming | |||
What commands do you use to name a workbook, save a workbook,open a workbook | Excel Programming |