Getting an error when using HypModifyConnection to update the report connection
Summary:
Trying to use HypModifyConnection but getting this error message:
Code Snippet (add any code snippets that support your topic, if applicable):
Private Declare PtrSafe Function HypModifyConnection Lib "HsAddin" (vtDocumentName, vtSheetName, vtGridName As Variant, vtServer, vtURL, vtApp, vtDB, vtConnParam) As Long
Sub Macro1()
' Macro1 Macro
Connection_String = Range("D5").Value
'modify url in a particular workbook for all SV sheets
s = HypModifyConnection("Change Connections.xlsm", "Sheet2", "", "", Connection_String, "", "", "")
End Sub
The cell D5 contains the server connection string:
When I run this macro, I'm getting an error message - see above. I tried to remove Sheet2 and the file name, to update all sheets in the workbook, to no avail. Same error code.