DefaultWebOptions.TargetBrowser Property (Excel)

Returns or sets an MsoTargetBrowser constant indicating the browser version. Read/write.


expression .TargetBrowser

expression A variable that represents a DefaultWebOptions object.


MsoTargetBrowser can be one of these MsoTargetBrowser constants.

msoTargetBrowserIE4 . Microsoft Internet Explorer 4.0 or later.

msoTargetBrowserIE5 . Microsoft Internet Explorer 5.0 or later.

msoTargetBrowserIE6 . Microsoft Internet Explorer 6.0 or later.

msoTargetBrowserV3 . Microsoft Internet Explorer 3.0, Netscape Navigator 3.0, or later.

msoTargetBrowserV4 . Microsoft Internet Explorer 4.0, Netscape Navigator 4.0, or later.


In this example, Microsoft Excel determines if the browser version for Web options is IE5 and notifies the user.

Sub CheckWebOptions() 
    Dim wkbOne As Workbook 
    Set wkbOne = Application.Workbooks(1) 
    ' Determine if IE5 is the target browser. 
    If wkbOne.WebOptions.TargetBrowser = msoTargetBrowserIE5 Then 
        MsgBox "The target browser is IE5 or later." 
        MsgBox "The target browser is not IE5 or later." 
    End If 
End Sub

See Also


DefaultWebOptions Object

DefaultWebOptions Object Members