Results 1 to 2 of 2

Thread: Assign Object

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2007
    Posts
    5

    Assign Object

    I need some code that will assign the currently open instance of Excel to an object. Maybe something like this

    objXL = SelectObject("Excel.Application")

    or

    objXL = GetObject("Excel.Application")

    I don't know what object command, if any, to use here. Any thoughts?

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Assign Object

    The GetObject version is what you want - but it has unpredictable results (if there are 3 instances of Excel open, you can't tell which one it will return).

    For further info (and code to work with it once you have the object), see the tutorial link in my signature.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width