Results 1 to 2 of 2

Updating from master file to read-only slave file

Threaded View

  1. #1
    Registered User
    Join Date
    06-09-2009
    Location
    Veldhoven, Netherlands
    MS-Off Ver
    2010 (Word, Excel, Powerpoint, Outlook)
    Posts
    36

    Updating from master file to read-only slave file

    Hi! I'm working on a problem, which included two files: a master excel file and a slave read-only excel file. Both are with macro's.

    The first file is the so-called master file. This file is open and is available for reading and writing.

    The second file is the so-called slave file. This file is open and is read-only. The file is essentally a copy of the master file. Its cells contains references to the master file - like: ='[test-from.xlsm]Sheet1'!A2.

    Both are on a server and the files are normally not opened on the same computer.

    What a macro needs to do at the master file, is to save every 30 seconds, since it has been opened. I've tried doing that using this code:

    Private Sub Auto_Open()
    
        'call all subs to start automatically
        Call StartTimer
    
    End Sub
    
    ===
    
    Sub Save_Timer()
        
        'TODO make if-statement to only save when workbook has changed
    
        ActiveWorkbook.Save
        'save ActiveWorkbook
       
        Application.OnTime Now() + TimeValue("00:00:30"), "Save_Timer"
        'starts timer to run for 30 seconds and starts Save_Timer
       
    End Sub
    What a second module needs to do at the slave file, is to update every reference (in essence recalculating?) and save afterwards every 15 seconds.

    The code I've made so far:
    Private Sub Auto_Open()
    
        'call all subs to start automatically
        Call Update_Links
        
    End Sub
    
    Sub Update_Links()
        
        'TODO make if-statement to only save when workbook has changed
    
        Application.CalculateFull
        'update all links
    
        ActiveWorkbook.Save
        'save ActiveWorkbook
       
        Application.OnTime Now() + TimeValue("00:00:15"), "Save_Timer"
        'starts timer to run for 15 seconds and starts Save_Timer
       
    End Sub
    How simple this might seem, it does not work. Anyone in to help a lost Excel user?
    Last edited by Lithium; 07-13-2009 at 04:45 PM. Reason: Set [Solved]

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1