Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 10-03-2024, 06:45 PM
Logit Logit is offline Can Excel VBA auto-update a co-shared workbook every ten seconds? Windows 10 Can Excel VBA auto-update a co-shared workbook every ten seconds? Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

The following works here. Paste into a Regular Module. When the workbook opens, the saving macro initiates. When the workbook closes, the macro stops.

Code:
Dim TimeToRun

Sub auto_open()
    Call ScheduleCopyPriceOver
End Sub

Sub ScheduleCopyPriceOver()
On Error Resume Next
    TimeToRun = Now + TimeValue("00:00:05")
    DoEvents
    Application.OnTime TimeToRun, "CopyPriceOver"
End Sub

Sub CopyPriceOver()
On Error Resume Next
    ThisWorkbook.Save
    Call ScheduleCopyPriceOver
End Sub

Sub auto_close()
    On Error Resume Next
    Application.DisplayAlerts = True
    Application.OnTime TimeToRun, "CopyPriceOver", , False
End Sub
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VBA Loop to update formula in certain cells and create copy in new workbook off dynamic range bwosk Excel Programming 1 10-07-2021 10:36 AM
Excel 2010 - Shared Workbook greyed out osheac3*40 Excel 0 03-08-2016 11:40 PM
OneDrive + iPhone Excel: Cannot Update Workbook? markg2 Excel 0 12-07-2014 09:02 AM
Shared Excel workbook eguru2 Excel 0 07-12-2011 12:02 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:54 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft