WebOptions.TargetBrowser property (Excel)

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



expression A variable that represents a WebOptions object.


In this example, Microsoft Excel determines if the browser version for web options is Internet Explorer 5 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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.