![]() |
Links to Update every 10 seconds...
Hi,
this code works fine when I open it the workbook. However the ecxel workbook is on a common drive when a different user opens the workbook the code does not work. It seems like there is something wrong with the trigering of it. Couldn't figure out the problem. Any help would be appreciated...thanks, Ozgur Under ThisWorkbook... Private Sub Workbook_Open() Call StartTimer End Sub Module1... Public RunWhen As Double Public Const cRunIntervalSeconds = 10 Public Const cRunWhat = "The_Sub" Sub StartTimer() RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds) Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=True End Sub Sub The_Sub() ActiveWorkbook.UpdateLink Name:="R:\treasury\Fin Analysis\Draft\AAA.xls", Type:=xlExcelLinks End Sub Sub StopTimer() On Error Resume Next Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=False End Sub |
Links to Update every 10 seconds...
Be sure you and the other users have the same Security level set.
-- Gary''s Student - gsnu200767 "Ozgur Pars" wrote: Hi, this code works fine when I open it the workbook. However the ecxel workbook is on a common drive when a different user opens the workbook the code does not work. It seems like there is something wrong with the trigering of it. Couldn't figure out the problem. Any help would be appreciated...thanks, Ozgur Under ThisWorkbook... Private Sub Workbook_Open() Call StartTimer End Sub Module1... Public RunWhen As Double Public Const cRunIntervalSeconds = 10 Public Const cRunWhat = "The_Sub" Sub StartTimer() RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds) Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=True End Sub Sub The_Sub() ActiveWorkbook.UpdateLink Name:="R:\treasury\Fin Analysis\Draft\AAA.xls", Type:=xlExcelLinks End Sub Sub StopTimer() On Error Resume Next Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=False End Sub |
Links to Update every 10 seconds...
Rather than using the drive name use the server name like so:
ActiveWorkbook.UpdateLink Name:="\\servernamegoeshere\treasury\Fin Analysis\Draft\AAA.xls", That should solve the problem as long as the other users have access to the Treasury anf Fin Analysis folders. -- If this posting was helpful, please click on the Yes button. Regards, Michael Arch. "Ozgur Pars" wrote: Hi, this code works fine when I open it the workbook. However the ecxel workbook is on a common drive when a different user opens the workbook the code does not work. It seems like there is something wrong with the trigering of it. Couldn't figure out the problem. Any help would be appreciated...thanks, Ozgur Under ThisWorkbook... Private Sub Workbook_Open() Call StartTimer End Sub Module1... Public RunWhen As Double Public Const cRunIntervalSeconds = 10 Public Const cRunWhat = "The_Sub" Sub StartTimer() RunWhen = Now + TimeSerial(0, 0, cRunIntervalSeconds) Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=True End Sub Sub The_Sub() ActiveWorkbook.UpdateLink Name:="R:\treasury\Fin Analysis\Draft\AAA.xls", Type:=xlExcelLinks End Sub Sub StopTimer() On Error Resume Next Application.OnTime earliesttime:=RunWhen, procedu=cRunWhat, schedule:=False End Sub |
All times are GMT +1. The time now is 07:48 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com