Results 1 to 5 of 5

Thread: Is it possible get open excel file via GetObject in 64-bit?

  1. #1

    Thread Starter
    Addicted Member sergeos's Avatar
    Join Date
    Apr 2009
    Location
    Belarus
    Posts
    167

    Is it possible get open excel file via GetObject in 64-bit?

    Hi guys!
    I made unsuccessful attempts to get the running Excel-object.
    Code:
    Set objExcel = GetObject(, "Excel.Application")
    In Windows 7-32b this procedure works correctly.
    But under Windows 8-64b on this line, an error occurs:
    "Run-Time Error '429': ActiveX component can't create object"
    Also, this code is working:
    Code:
    Set objExcel = CreateObject("Excel.Application")
    But I need to get a running instance.

    I'm use Windows 8-64 and Excel 2013.
    Ten Years After - 01 You Give Me Loving

  2. #2

    Thread Starter
    Addicted Member sergeos's Avatar
    Join Date
    Apr 2009
    Location
    Belarus
    Posts
    167

    Re: Is it possible get open excel file via GetObject in 64-bit?

    No ways?
    Ten Years After - 01 You Give Me Loving

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Is it possible get open excel file via GetObject in 64-bit?

    Set objExcel = GetObject(, "Excel.Application")
    works for me in w10 64, xl 2013 32
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  4. #4
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,229

    Re: Is it possible get open excel file via GetObject in 64-bit?

    is office/excel 64bit or 32bit?

  5. #5
    Fanatic Member
    Join Date
    Apr 2015
    Location
    Finland
    Posts
    692

    Re: Is it possible get open excel file via GetObject in 64-bit?

    set xlApp = GetObject(, "Excel.Application")

    If an instance of Microsoft Excel is running when this code is executed, you have access to the running instance's object model through the xlApp variable. If no instance is running, you receive the following trappable run-time error message:
    Run-time error '429':
    ActiveX component can't create object
    https://support.microsoft.com/en-us/kb/288902

    Use late binding...
    http://windowssecrets.com/forums/sho...l-through-word

    However using late binding, one looses intellisense, so best of both worlds - during development use early- and in compiled executable late binding.
    http://nuke.vbcorner.net/Articoli/VB...T/Default.aspx
    Last edited by Tech99; May 16th, 2016 at 11:45 PM.

Tags for this Thread

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