Visual Basic CreateObject 函数定义和用法CreateObject 函数可创建一个指定类型的对象。
语法CreateObject(servername.typename[,location])参数描述servername必需的。提供此对象的应用程序名称。typename必需的。对象的类型或类(type/class)。location可选的。在何处创建对象。
实例例子 1Module Module1 Sub Main() Dim myexcel; Set myexcel=CreateObject("Excel.Sheet"); myexcel.Application.Visible=True; ...code... myexcel.Application.Quit Set myexcel=Nothing End SubEnd Module