Update multiple sheets simultaneously

Closed
renukam64 Posts 1 Registration date Wednesday June 30, 2010 Status Member Last seen June 30, 2010 - Jun 30, 2010 at 01:58 AM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Jun 30, 2010 at 04:04 AM
Hello,

How to update two identical workbooks in different locations in same pc simultaneously.
I have two identical excel workbooks. When I update/change original workbook, duplicate workbook should be updated automaticaly.

Related:

1 response

rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 766
Jun 30, 2010 at 04:04 AM
Well one option could be that on save, you save it twice. once as this file and one as other file. This piece of code needs to go to ThisWorkbook module in VBE

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)  
    Application.EnableEvents = False  
        cancel = true  
        ThisWorkbook.SaveAs "c:\location1\book1.xls"  
        ThisWorkbook.SaveAs "c:\location2\book1.xls"  
          
      
    Application.EnableEvents = True  
End Sub
1