Hi,
I have a problem when I try to call macro from sharepoint's workbook from local file.
I tried use below code but it doesn't work (it does if file is local)
It give Err.Description
The macro ''http://***/***/filename.xls'!Macro' cannot be found.
Err.Number 1004
Sub test()
Dim spFile As String
'file located on sharepoint
spFile = "http://..../file.xls"
If Workbooks.CanCheckOut(spFile) Then
Workbooks.CheckOut filename:=spFile
Workbooks.Open filename:=spFile
Application.Run "'" & spFile & "'!MacroName"
Workbooks(spFile).CheckIn (True)
Else
MsgBox "Workbook checked out by sb else"
End If
End Sub
Please help!!!
I have a problem when I try to call macro from sharepoint's workbook from local file.
I tried use below code but it doesn't work (it does if file is local)
It give Err.Description
The macro ''http://***/***/filename.xls'!Macro' cannot be found.
Err.Number 1004
Sub test()
Dim spFile As String
'file located on sharepoint
spFile = "http://..../file.xls"
If Workbooks.CanCheckOut(spFile) Then
Workbooks.CheckOut filename:=spFile
Workbooks.Open filename:=spFile
Application.Run "'" & spFile & "'!MacroName"
Workbooks(spFile).CheckIn (True)
Else
MsgBox "Workbook checked out by sb else"
End If
End Sub
Please help!!!
Last edited: