0
votes

I am trying to use a button click to open a webpage on a secure SharePoint site, using SSO (single sign-on). This works in Excel with the hyperlink set as a property to a shape and no VBA or macro (automatically runs Microsoft sign-on dialog box), but not in Access. I receive the error "Unable to open https://company.sharepoint.com/sites/Lean%20Home.aspx. Cannot download the information you requested." Or I get a "Run-time Error '8' Cannot download the information you requested."

If I set the hyperlink in the button properties Hyperlink area, I can open the dialog box, click "bookmark", receive the message that the document has no bookmarks, and then the hyperlink works. It will not work through VBA, and I don't want to manipulate through the bookmarks error to get the hyperlinks property dialog to work.

My generic code is:

Private Sub Cmd_ZD_Homepage_Click()

  Application.FollowHyperlink "https://company.sharepoint.com/sites/Lean%20Home.aspx"

End Sub

What do I need to add to the VBA code to work through the SSO portion of the webpage?

1
I copied/pasted the module and then inserted this code into my VBA:Private Sub Cmd_ZD_Homepage_Click() Call PrepHyperlink("https://company.sharepoint.com/sites/Lean%20Home.aspx") strAddress = "https://company.sharepoint.com/sites/Lean%20Home.aspx" Call GoHyperlink("https://company.sharepoint.com/sites/Lean%20Home.aspx") End Sub I still receive the same error. I am not familiar with public functions, so I assume I am calling it incorrectly in my code for the button click?Lisa
You would call the function GoHyperlink. That function calls PrepHyperlink, you don't.June7
It is possible this code will not resolve your issue.June7

1 Answers

1
votes

I had some issues with FollowHyperlink so used Windows Shell to run:

Private Sub btnLink_Click()
On Error GoTo ErrProc
'FollowHyperlink is not working properly
''Application.FollowHyperlink Me.tbxLink
Dim wsShell As Object
Set wsShell = CreateObject("WScript.Shell")
wsShell.Run Chr(34) & Me.tbxLink & Chr(34)
Me.Title.SetFocus
ExitProc:
Set wsShell = Nothing
Exit Sub
ErrProc:
MsgBox "Cannot open document. Contact database administrator. : " & Err.Number
End Sub

However, I was just opening PDF files, not a web page associated with SharePoint.