View Single Post
  #3  
Old September 16th, 2003, 08:02 AM
Bill Manville
external usenet poster
 
Posts: n/a
Default Update timeframe for linked data.

J Marro wrote:
It appears that EditLinksUpdate Now cannot be executed on a Protected
sheet? When the sheet is Protected Update Now is greyed out.

Correct.
So you run a macro:

Sub UpdateMe()
ActiveSheet.Protect UserInterfaceOnly:=True
ActiveWorkbook.UpdateLink ActiveWorkbook.LinkSources(xlExcelLinks)(1)
End Sub

An OnTime macro
cannot be executed on a Protected sheet - I get an error saying as much.

The above can be executed as an OnTime macro.

Dim NextTime As Date

Sub Auto_Open()
NextTime = Now+TimeValue("00:01:00")
Application.OnTime NextTime, "UpdateMe"
End Sub

Sub Auto_Close()
Application.OnTime NextTime, "UpdateMe", schedule:=False
End Sub

Sub UpdateMe()
ActiveSheet.Protect UserInterfaceOnly:=True
ActiveWorkbook.UpdateLink ActiveWorkbook.LinkSources(xlExcelLinks)(1)
NextTime = Now+TimeValue("00:01:00")
Application.OnTime NextTime, "UpdateMe"
End Sub


is there
any reason I cannot run a macro that would Un-share the file, Unprotect the
file, Run EditLinksUpdate Now, reprotect the file and re-share?

I didn't think that the viewer file was a shared workbook.
It doesn't need to be, and there is no value in it being so. Just make it a
read-only workbook of which each user opens a copy.
You can't unshare a workbook if other users have it open, can you?

I do not encourage the use of shared workbooks.


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - respond to newsgroup