Results 1 to 8 of 8
  1. #1
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Access Command Line (2000 SR-1)

    I need to have a macro that will open a specific Excel workbook from Access. I don't need any integration, just want to open a specific file. Anybody?

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Access Command Line (2000 SR-1)

    You need code to do it, not a macro. If you don't want automation, you can use the Shell() function to run the other application, but then you extremely limited control over it.

    Here's the Shell syntax from help:

    Dim RetVal
    RetVal = Shell("C:WINDOWSCALC.EXE", 1) ' Run Calculator.
    Charlotte

  3. #3
    New Lounger
    Join Date
    Jan 2001
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Command Line (2000 SR-1)

    I am sorry to disagree with Charlotte, but I have found a macro to be a good way to open a specific document in Excel or Word. The key is to write the command line in the RunApp action. You have to type in the specific path to Excel.exe. You have to insert a space. Then you have to type in the specific path to the Excel file.

    Example:

    c:Program FilesMicrosoft OfficeOfficeExcel.exe c:MyDocumentsExcelFilesMyExcelFile.xls

    You can even run a macro located in your Excel file by adding a switch at the end of the Command line.

    Example:

    c:Program FilesMicrosoft OfficeOfficeExcel.exe c:MyDocumentsExcelFilesMyExcelFile.xls /mMacroName.

    It does work.

    (Sorry Charlotte)

  4. #4
    4 Star Lounger
    Join Date
    Dec 2000
    Location
    Quakertown, PA, Pennsylvania, USA
    Posts
    517
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Command Line (2000 SR-1)

    Well, the guys at work told me it was possible. I just didn't know the syntax, so thank you so much!

  5. #5
    New Lounger
    Join Date
    Jan 2001
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Command Line (2000 SR-1)

    I gave you the syntax for Access 97. I should have said that first. But, it should work in 2000. Give it a try and let me know how it comes out. And, you are welcome.

  6. #6
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Access Command Line (2000 SR-1)

    Don't worry about disagreeing. I so rarely use macros for anything that I forgot about the RunApp action. I don't like the lack of control and error handling you have in macros. <img src=/S/shrug.gif border=0 alt=shrug width=39 height=15>
    Charlotte

  7. #7
    New Lounger
    Join Date
    Jan 2001
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Access Command Line (2000 SR-1)

    Thanks, Charlotte. I like the macros. One question, do you ever sleep?

  8. #8
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Access Command Line (2000 SR-1)

    Of course I sleep, usually in the office. <img src=/S/laugh.gif border=0 alt=laugh width=15 height=15>
    Charlotte

Posting Permissions

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