CreateObject 함수

CreateObject 함수는 지정된 유형의 객체를 생성합니다.

구문

CreateObject(ObjectName)

인수:

ObjectName: 필수. 객체의 이름입니다.

지원되는 객체 이름

  • Scripting.FileSystemObject
  • Scripting.Dictionary
  • System.Collections.ArrayList
  • ADODB.Connection
  • ADODB.RecordSet
  • WScript.Shell
  • VBScript.RegExp

다음 예에서는 Createobject 함수의 사용을 보여 줍니다.

예 1:

Dim fso, tso
Set fso = CreateObject("Scripting.FileSystemObject")
Set tso = fso.CreateTextFile("C:\example.txt", True)
tso.WriteLine("Hello World!")
tso.Close