Multiple Connections to Excel

Discussion in 'AutoCAD' started by TommyJ, Nov 11, 2004.

  1. TommyJ

    TommyJ Guest

    Hello All,

    I am running VBA with AutoCAD 2004. The simple question may be this: if the current user has an Excel file opened on their current workstation, can the same file be opened with write permission from VBA. Currently, the user session and the VBA session appear to step on each other.

    If the answer is no, any suggestions? VB?

    Thanks,

    Tom
     
    TommyJ, Nov 11, 2004
    #1
  2. TommyJ

    Norman Yuan Guest

    If you want more than one user to access the same workbook of Excel (*.xls
    file), you need to share to workbook: open the *.xls file; click menu
    "tools->share workbook...".



    the current user has an Excel file opened on their current workstation, can
    the same file be opened with write permission from VBA. Currently, the user
    session and the VBA session appear to step on each other.
     
    Norman Yuan, Nov 12, 2004
    #2
  3. TommyJ

    Kevin Terry Guest

    You can access the currently open file in excel thru vba in autocad, and
    even write to it while the user watches and edits the same workbook if you
    like. Just be careful you don't use any 'Select' statements in the code
    which would activate a cell while the user possibly is editing a different
    one.

    Kevin

    the current user has an Excel file opened on their current workstation, can
    the same file be opened with write permission from VBA. Currently, the user
    session and the VBA session appear to step on each other.
     
    Kevin Terry, Nov 12, 2004
    #3
  4. TommyJ

    Jackrabbit Guest

    Iterate through the Workbooks collection and see if the file is already open. If it is, you can write to it. If it isn't open, then open it.
     
    Jackrabbit, Nov 12, 2004
    #4
  5. TommyJ

    TommyJ Guest

    Thanks to all of you. Your comments got me started down the right path and everything is now working like a charm.

    Tom
     
    TommyJ, Nov 12, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.