VBScript CreateObject 関数
定義と用法
CreateObject 関数は指定されたタイプのオブジェクトを作成します。
構文
CreateObject(servername.typename[,location])
パラメータ | 説明 |
---|---|
servername | 必須。このオブジェクトを提供するアプリケーションの名前。 |
typename | 必須。オブジェクトのタイプまたはクラス(type/class)。 |
location | オプション。オブジェクトを作成する場所。 |
インスタンス
例 1
dim myexcel Set myexcel=CreateObject("Excel.Sheet") myexcel.Application.Visible=True ...コード... myexcel.Application.Quit Set myexcel=Nothing