Results 1 to 3 of 3
  1. #1
    klnlsu is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    107

    QuitAccess command not working in macro

    I've created a simple macro that I run from a shortcut outside of Access. It runs some VBA code (working), then closes the database (working), then quits Access (not working). I don't get an error message (such as "'Quit' not available). It simply doesn't close. My macro commands are below. I call this macro via the shortcut with Task Scheduler. I have a batch file in my task that will not run until Access closes.



    Click image for larger version. 

Name:	macro.jpg 
Views:	6 
Size:	9.9 KB 
ID:	21092
    Attached Thumbnails Attached Thumbnails macro2.jpg  

  2. #2
    klnlsu is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    107
    Additional Info:
    When I run the macro directly from the shortcut, Access simply doesn't close at the end. When I run the macro using the shortcut in Task Scheduler, I get the following message:

    Click image for larger version. 

Name:	message.jpg 
Views:	8 
Size:	39.9 KB 
ID:	21094

  3. #3
    klnlsu is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    107
    I solved it! I couldn't use a shortcut to the macro. I had to set up my task scheduler as described at the bottom of this link:

    http://stackoverflow.com/questions/2...scheduled-task

    I put "C:\Program Files\Microsoft Office 15\root\office15\MSACCESS.EXE" in my Program/Script box
    and "O:\Eshipping\Eshipping.accdb" /x "ExportEshipping" in my Add Arguments box (i.e. database name, followed by "/x", then macro name)

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

Similar Threads

  1. Replies: 13
    Last Post: 01-22-2015, 05:27 PM
  2. Replies: 1
    Last Post: 01-21-2015, 02:02 PM
  3. Command Button to Run Macro, can't find macro
    By Ace2014 in forum Modules
    Replies: 22
    Last Post: 06-11-2014, 11:42 AM
  4. Macro Command ImportExportText
    By RubyBosch in forum Import/Export Data
    Replies: 3
    Last Post: 12-19-2012, 12:58 PM
  5. run a windodws command from macro
    By broecher in forum Programming
    Replies: 5
    Last Post: 09-12-2010, 04:46 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