Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2002
    Posts
    6

    Red face Unanswered: Access and Excel

    I need help

    I am not a big programmer but I have been learning basic stuff with visual basic lite in Excel. I have been building an application in excel recently but the size of the database have outgrown excel. So now I need to use Excel to performe some Webqueries and Access to manage the data.

    I have tryed many things but I am unable to start an excel file from access, have access wait for the program to end, and shut the file. For example: if I want to load an Autostart excel program in c:\webspy\spy.xls.... ( the macro runs for about 2 hours so Access needs to wait ) and shut it done and then have access finish the job.

    How do I do the excel part? Could someone past a routine for me?

    Thank you...

  2. #2
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    have you designed the Excel application to close itself.

    If so, I have a solution for you.

    In other words, I've got code which will launch the Excel program and wait for it to quit. Once it quits, Access will resume processing.

    Is this what you are looking for?

  3. #3
    Join Date
    Nov 2001
    Posts
    336
    Hi,

    I just came across code posted by another programmer, which does what you need. Ken, I am sorry for jumping in your posting, but the code below is so neat, that I fealt obligated to post it.

    Dim o9 As Object

    Set o9 = CreateObject("WScript.Shell")
    o9.Run "c:\x1.xls", 1, True
    MsgBox "Done"

    Set o9 = Nothing

    Sincerely,

  4. #4
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    Wow, that is very cool!

    IGelin, you know of my affinity for tight code, and this is much tighter than anything I could have provided.

    I'm going to test this later today.

    Cool!

  5. #5
    Join Date
    Sep 2001
    Location
    Chicago, Illinois, USA
    Posts
    601
    I just tested this thing it is really cool!

    It works asynchronously, waiting for the Excel process to complete before moving on.

    This is really nice.

    I just threw away 67 lines of code (which I thought was pretty tight) which did the same thing.

    Again, thanks IGelin

  6. #6
    Join Date
    Mar 2002
    Posts
    6

    Wooow!

    Wooow!

    Thank you so much!

    This is exactly what I needed! Works really fine!

    Reallllllllllllly appreciate your help here!

    bye

    Alex

Posting Permissions

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