Had deze nog in mijn kastje steken omdat ik er ooit ook eens achter aan't zoeken ben geweest.
Heb'm net getest en voor mij werkt hij nog steeds.
Om te starten run de tst-macro.
'---------------------------------------------------------------------------------------
' Procedure : OpenURLInFF
' Author : Daniel Pineault, CARDA Consultants Inc.
' Website : http://www.cardaconsultants.com
' Purpose : Open a URL in FireFox
' Copyright : The following is release as Attribution-ShareAlike 4.0 International
' (CC BY-SA 4.0) - https://creativecommons.org/licenses/by-sa/4.0/
' Req'd Refs: Uses Late Binding, so none required
'
' Input Variables:
' ~~~~~~~~~~~~~~~~
' sURL : URL to open in FifeFox
'
' Usage:
' ~~~~~~
' Call OpenURLInFF("http://www.google.ca")
' Call OpenURLInFF("devhut.net")
'
' Revision History:
' Rev Date(yyyy/mm/dd) Description
' **************************************************************************************
' 1 2014-11-13 Initial Release
' 2 2018-02-01 Updated Copyright under CC licensing
' Error trapped FireFox not installed
'---------------------------------------------------------------------------------------
Sub OpenURLInFF(ByVal sURL As String)
On Error GoTo Error_Handler
Dim WSHShell As Object
Dim sFFExe As String 'FF executable path/filename
'Determine the Path to FF executable
Set WSHShell = CreateObject("WScript.Shell")
sFFExe = WSHShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Firefox.EXE\")
'Open the URL
Shell """" & sFFExe & """" & " -new-tab """ & sURL & "", vbHide
Error_Handler_Exit:
On Error Resume Next
If Not WSHShell Is Nothing Then Set WSHShell = Nothing
Exit Sub
Error_Handler:
If Err.Number = -2147024894 Then
MsgBox "FireFox does not appear to be installed on this compter", _
vbInformation Or vbOKOnly, "Unable to open the requested URL"
Else
MsgBox "The following error has occurred" & vbCrLf & vbCrLf & _
"Error Number: " & Err.Number & vbCrLf & _
"Error Source: OpenURLInFF" & vbCrLf & _
"Error Description: " & Err.Description & _
Switch(Erl = 0, "", Erl <> 0, vbCrLf & "Line No: " & Erl) _
, vbOKOnly + vbCritical, "An Error has Occurred!"
End If
Resume Error_Handler_Exit
End Sub
Sub tst()
OpenURLInFF ("https://www.mijnwebsite.nl")
End Sub