TargetBrowser Property

Microsoft Excel Visual Basic

Show All

TargetBrowser Property

       

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

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.

 

expression.TargetBrowser

expression   Required. An expression that returns one of the objects in the Applies To list.

Example

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."
    Else
        MsgBox "The target browser is not IE5 or later."
    End If

End Sub