• Access Command Line (2000 SR-1)

    Author
    Topic
    #360093

    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?

    Viewing 1 reply thread
    Author
    Replies
    • #541379

      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.

    • #541393

      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)

      • #541395

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

        • #541398

          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.

      • #541409

        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. shrug

        • #541411

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

    Viewing 1 reply thread
    Reply To: Access Command Line (2000 SR-1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: