After experiencing a lot of down time, We decided to move this site to
CrystalTech.com. CrystalTech.com is powered by only the finest Windows servers providing the best performance, reliability, and value anywhere.
CreateObject - Possibilities
|
Author |
Message
|
tfecker
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 2/22/2010
-
Status: offline
|
CreateObject - Possibilities
Tuesday, February 23, 2010 10:16 PM
( permalink)
Hi, I'm starting with VBS and still get confused about often "Create.Object" is used with several possibilities. CreateObject(servername.typename) servername = Required. The name of the application that provides the object typename = Required. The type/class of the object Is there a list of types and classe I can use? And what happens f.e. when I haven't installed Excel on my maschine but wanna script like Set objExcel = CreateObject("Excel.Application") objExcel.Visible = True objExcel.Workbooks.Add For i = 1 to 56 objExcel.Cells(i, 1).Value = i objExcel.Cells(i, 1).Interior.ColorIndex = i Next Thanks a lot for input Thomas
|
|
|
|
ehvbs
-
Total Posts
:
3312
- Scores: 110
-
Reward points
:
0
- Joined: 6/22/2005
- Location: Germany
-
Status: offline
|
Re:CreateObject - Possibilities
Wednesday, February 24, 2010 3:11 AM
( permalink)
There is no uiversal list of possible arguments to the CreateObject function, because what you can use depends on the COM Objects with IDispatch interface installed (registered) on your computer. see: http://technet.microsoft..../library/ee198909.aspx If you want to automate Excel on a computer with no Excel installed, you either adapt your wishes to the reality (stop wanting) or the reality to your wishes (install Excel).
|
|
|
|
ebgreen
-
Total Posts
:
8088
- Scores: 95
-
Reward points
:
0
- Joined: 7/12/2005
-
Status: offline
|
Re:CreateObject - Possibilities
Wednesday, February 24, 2010 3:15 AM
( permalink)
First off, if a component is not installed, then you can't instantiate it, so you would get an error. To find available objects, the simplest way is to look at the HKEY_CLASSES_ROOT hive in the registry.
|
|
|
|
tfecker
-
Total Posts
:
2
- Scores: 0
-
Reward points
:
0
- Joined: 2/22/2010
-
Status: offline
|
Re:CreateObject - Possibilities
Friday, February 26, 2010 10:08 PM
( permalink)
Hi, thanks for your answers that both is helpfull to know. And - I just wanna write the script on my laptop for someone who has Excel. But your right when I would like make the automation I def. should have installed the software I wanna automate ;o) And the List I got out of "HKEY_CLASSES_ROOT" is quiet a good one ! Thats it. Kind regards Thomas
|
|
|
|
Online Bookmarks Sharing: