mbt masai
 
Welcome !
         

                                
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)
0
[Helpful answer received] / [List Solutions Only]
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










#1
    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)
    0
    [This post was marked as helpful]
    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).
    #2
      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)
      0
      [This post was marked as helpful]
      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.
      "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
      Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
      http://www.visualbasicscript.com/m_47117/tm.htm
      #3
        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)
        0
        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
        #4

          Online Bookmarks Sharing: Share/Bookmark

          Jump to:

          Current active users

          There are 0 members and 1 guests.

          Icon Legend and Permission

          • New Messages
          • No New Messages
          • Hot Topic w/ New Messages
          • Hot Topic w/o New Messages
          • Locked w/ New Messages
          • Locked w/o New Messages
          • Read Message
          • Post New Thread
          • Reply to message
          • Post New Poll
          • Submit Vote
          • Post reward post
          • Delete my own posts
          • Delete my own threads
          • Rate post

          2000-2012 ASPPlayground.NET Forum Version 3.8
          mbt shoes www.wileywilson.com