+ Reply to Thread
Results 1 to 5 of 5

Determine number of open excel files

  1. #1
    gw.boswell@gmail.com
    Guest

    Determine number of open excel files

    I have a macro in which I need to open a specific Excel file.
    Unfortunately with the code below although I can open the file, whether
    it is visible and can be accessed depends on how many other Excel files
    are open. How can I determine how many excel files are already open

    Set xlAppEval = GetObject(, "Excel.Application")

    Set Model = GetObject("c:\EVAL.xls")

    xlAppEval.Application.Visible = True
    xlAppEval.Parent.Windows(3).Visible = True <== only works if 2 excel
    files are already open.


    Alternatively, is there a better way to open the specified as an OLE
    object?

    TIA,
    Garry


  2. #2
    Jim Cone
    Guest

    Re: Determine number of open excel files

    Garry,
    Dim lngX as Long
    lngX = xlAppEval.Workbooks.Count
    --
    Jim Cone
    San Francisco, USA
    http://www.realezsites.com/bus/primitivesoftware


    <gw.boswell@gmail.com>
    wrote in message
    I have a macro in which I need to open a specific Excel file.
    Unfortunately with the code below although I can open the file, whether
    it is visible and can be accessed depends on how many other Excel files
    are open. How can I determine how many excel files are already open

    Set xlAppEval = GetObject(, "Excel.Application")
    Set Model = GetObject("c:\EVAL.xls")

    xlAppEval.Application.Visible = True
    xlAppEval.Parent.Windows(3).Visible = True <== only works if 2 excel
    files are already open.
    Alternatively, is there a better way to open the specified as an OLE
    object?

    TIA,
    Garry


  3. #3
    gw.boswell@gmail.com
    Guest

    Re: Determine number of open excel files

    Jim,
    You auggestion worked perfectly (which I'm sure you knew it would).
    Thanks you very much. That makes my life a lot easier.
    Garry


  4. #4
    gw.boswell@gmail.com
    Guest

    Re: Determine number of open excel files

    Jim,
    You suggestion worked perfectly (which I'm sure you knew it would).
    Thanks you very much. That makes my life a lot easier.
    Garry


  5. #5
    Jim Cone
    Guest

    Re: Determine number of open excel files

    Garry,
    You are welcome.
    Jim Cone
    San Francisco, USA
    http://www.officeletter.com/blink/specialsort.html


    <gw.boswell@gmail.com> wrote in message news:1148563619.791650.170890@i39g2000cwa.googlegroups.com...
    Jim,
    You suggestion worked perfectly (which I'm sure you knew it would).
    Thanks you very much. That makes my life a lot easier.
    Garry


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1