How to launch a URL from VBA in Microsoft Dynamics GP
So you have created this great customization and part of it is to launch a URL and pass in some parameters via http. For example, a customization on the customer master that will open the customer's invoice entry portal where you can type in the invoice information. The following code can be placed in the (General) section of your VBA customization and be called from any other event, for example the BeforeUserChanged event. Public Function OpenBrowser(ByVal URL As String) As Boolean Dim res As Long ' it is mandatory that the URL is prefixed with http:// or https:// If InStr(1, URL, "http", vbTextCompare) 1 Then URL = "http://" & URL End If result = ShellExecute(0, "open", URL, vbNullString, vbNullString, vbNormalFocus) OpenBrowser = (result > 32) End Function You can call the ShellExecute() Windows API function from a Visual Basic for Applications in Microsoft Dynamics GP to start another program under Microsoft Windows. Use ShellExecute...