CreateObjectWS
CreateObjectWS is a function in the Windows Script Host (WSH) that allows scripts to create and manipulate COM objects. It is a part of the WSH object model and is used primarily in VBScript and JScript to interact with various COM components. The function takes two parameters: the ProgID or CLSID of the COM object and an optional parameter that specifies the server where the object should be created.
The syntax for CreateObjectWS is as follows:
CreateObjectWS(progID, serverName)
progID is a string that specifies the ProgID or CLSID of the COM object to be created.
CreateObjectWS returns a reference to the created COM object, which can then be used to call its
One common use of CreateObjectWS is to create instances of Microsoft Office applications such as Excel or
Set objExcel = CreateObjectWS("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Add
Set objWorksheet = objWorkbook.Worksheets.Add
It is important to note that CreateObjectWS is not available in all versions of WSH. It was
In summary, CreateObjectWS is a powerful function in WSH that allows scripts to create and manipulate