TargetBrowser Property

WebOptions.TargetBrowser Property

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



expression   A variable that represents a WebOptions 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.

Visual Basic for Applications
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

© 2016 Microsoft