VBScript CreateObject 函數
定義和用法
CreateObject 函數可創建一個指定類型的對象。
語法
CreateObject(servername.typename[,location])
參數 | 描述 |
---|---|
servername | 必需的。提供此對象的應用程序名稱。 |
typename | 必需的。對象的類型或類(type/class)。 |
location | 可選的。在何處創建對象。 |
實例
例子 1
dim myexcel Set myexcel=CreateObject("Excel.Sheet") myexcel.Application.Visible=True ...code... myexcel.Application.Quit Set myexcel=Nothing