Script Property [Excel 2003 VBA Language Reference]

Returns the Script object, which represents a block of script or code on the specified Web page. If the page contains no script, nothing is returned.

expression.Script

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

Example

This example displays the type of scripting language used in the first shape on the active worksheet.

Set objScr = ActiveSheet.Shapes(1).Script
If Not (objScr Is Nothing) Then
    Select Case objScr.Language
        Case msoScriptLanguageVisualBasic
            MsgBox "VBScript"
        Case msoScriptLanguageJava
            MsgBox "JavaScript"
        Case msoScriptLanguageASP
            MsgBox "Active Server Pages"
        Case Else
            Msgbox "Other scripting language"
    End Select
End If

Applies to | Shape Object