Results 1 to 5 of 5
  1. #1
    virencm is offline Novice
    Windows 7 32bit Access 2016
    Join Date
    Jun 2019
    Posts
    5

    Run a bat file using VBA in MS ACCESS 2016

    Hi guys,



    I am trying to run a bat file from a 2016 access database and i get an error "INVALID PROCEDURE CALL OR ARGUMENT".
    The VBA code i am using is attached to a button

    Code:
    shell ("path\import_1.bat)
    Am i missing something? is there a specific reference that is required for running bat files? I have the "windows script object model"referenced.

    thanks for your help!

    Cheers
    V

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,207
    Not at a computer but try adding the Call keyword before Shell.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,225
    you are also missing a closing double quote

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    21,207
    Ack, I missed that.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,225
    also think 'path' is a strange name for a folder. So wonder if path is a variable in which case you would have

    path & "\import_1.bat"


Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 10-30-2018, 12:12 PM
  2. Replies: 4
    Last Post: 08-07-2018, 05:38 AM
  3. Replies: 3
    Last Post: 05-17-2018, 08:44 AM
  4. Open Access 2016 With Batch File
    By kdbailey in forum Access
    Replies: 16
    Last Post: 03-15-2018, 09:26 AM
  5. Replies: 1
    Last Post: 03-03-2017, 09:25 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums