Hi, an thank you. I had some problems with my password.

I put this code, but it doesn`t work

this is the whole code:

Sub testconnection()
[VBA]
Set Wkb = Workbooks.Open(Filename:="F:\Clients\PRCB\medium\connection.xlsm")
[/VBA]
[VBA]
Wkb.RefreshAll
[/VBA]
End Sub

I suggest that i am wrong somewhere.



Quote Originally Posted by DRJ View Post
You would need to open the files, refresh, then save. If they are opened by another user then this would not work.

When dealing with SharePoint I usually will map a network drive to the SharePoint folder. So for example if I map X:\ to the SharePoint folder then I could open the workbook like I normally would in a Windows folder.

[VBA]
Set Wkb = Workbooks.Open(Filename:="C:\SubFolder\Filename.xlsm")
[/VBA]

Depending on the data you want to refresh the following might work:

[VBA]
Wkb.RefreshAll
[/VBA]