VBA code to open a sharepoint file directly in Desktop app

kgkev

Well-known Member
Joined
Jun 24, 2008
Messages
1,285
Office Version
  1. 365
Platform
  1. Windows
I would like to add a sharepoint file to my tool bar so i can open it directly from the desktop app.

I know the file location in share point, but when adding this to the code It appears to open but I am left with just a blank page with title "fhsdjfhsd"

this is the code I have used...doctored slightly for security.

VBA Code:
Private Sub Production_Open()
Application.ScreenUpdating = False

Application.AskToUpdateLinks = False
    Workbooks.Open filename:= _
    "https://my.sharepoint.com/:x:/s/CriticalDateandCapacityPlanning/fhsdjfhsdjfhsd", _
    UpdateLinks:=0
End If

Application.ScreenUpdating = True
End Sub

is it possible?
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
I appreciate the need for privacy but is the filename fhsdjfhsd or is it more like fhsdjfhsd.xlsx?
 
Upvote 0
I appreciate the need for privacy but is the filename fhsdjfhsd or is it more like fhsdjfhsd.xlsx?
There is no file extension on the share point link. It's juts a series of letters

If I click the link it opens in the browser perfectly. But not when opening from vba.
 
Upvote 0
I have used SharePoint and have never seen that. Is the thing you are clicking on a SharePoint link (like a Windows shortcut) that refers to a file that is in a different physical location? I don't think VBA file references will resolve a shortcut link.
 
Upvote 0

Forum statistics

Threads
1,214,652
Messages
6,120,747
Members
448,989
Latest member
mariah3

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top