Hi All,

I created a spreadsheet in excel 2013 and had no issues with the code i created. when i try to run it i get the error code '28' and i have no idea to solve this.

PHP Code: 
Public Declare PtrSafe Sub Sleep Lib "kernel32" (ByVal A_Scound As Long)

Public 
Sub ScheduleJoodi_API()
    
ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources
    DoEvents
    Sleep 
(100)
    
ActiveWorkbook.UpdateLink Name:=ActiveWorkbook.LinkSources
    Joodi
Exit Sub
End Sub


Sub Joodi
()
    If 
Sheet1.Range("A1").Value 1 Then
    Application
.Calculation False
    Sheet1
.Range("A2:A4").Copy
    Sheet1
.Range("B2").PasteSpecial Paste:=xlPasteValuesOperation:=xlNoneSkipBlanks:=FalseTranspose:=False
    Application
.CutCopyMode False
    Range
("B1").Select
    Application
.Calculation True
 End 
If
    
Call ScheduleJoodi_API
End Sub 
If anyone could help out it would be greatly appreciated.

Thanks in advance,

Alex