How can I incorporate this code:
into my macro:
to force links that open in Internet Explorer in a new tab?
Code:
Sub TestNewTabInIE()
'Source: http://stackoverflow.com/questions/17386091/vba-excel-2010-open-internet-explore-in-new-tab
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
While .ReadyState <> 4 'READYSTATE_COMPLETE
DoEvents
Wend
' .Navigate "http://yahoo.com", CLng(2048)
.Navigate "[---Here I want to use Cellvalu (ActiveCell.Value)---]", CLng(2048)
End With
End Sub
Code:
Public Cellvalu As String
Public Brwsr As String
Sub LaunchBrowser()
Dim bPath As String
If Brwsr = "Firefox" Then
bPath = "C:\Program Files (x86)\Mozilla Firefox\firefox.exe"
ElseIf Brwsr = "IE" Then
' bPath = "C:\Program Files\Internet Explorer\iexplore.exe"
[---Where I want to substitute the new code---]
Else
Exit Sub
End If
Call Shell(bPath & " " & Cellvalu, vbNormalFocus)
End Sub