Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7818483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T06:35:20+00:00 2026-06-02T06:35:20+00:00

HI I am running a MS Access (2010) macro from Python 2.6.5. It’s running

  • 0

HI I am running a MS Access (2010) macro from Python 2.6.5. It’s running the macro successfully, but the accdb file is not closing all the way correctly. It shows a .laacdb file along with the .accdb file after my macro runs. I figured doing the CloseCurrentDatabase and Quit statements would do this but they are not. The .laacdb file goes away after I restart computer. Thank you.

from win32com.client import Dispatch
strDbName = "C:\\converter\\MainConverter.accdb"
objAccess = Dispatch("Access.Application")
objAccess.Visible = False
objAccess.OpenCurrentDatabase(strDbName)
objDB = objAccess.CurrentDb()
objAccess.DoCmd.RunMacro('Export_to_PDF')
objAccess.Application.CloseCurrentDatabase()
objAccess.Application.Quit
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T06:35:23+00:00Added an answer on June 2, 2026 at 6:35 am

    In VBA we routinely set object variables to Nothing to dispose of them. In Python, try explicitly deleting your objAccess variable.

    del objAccess
    

    Sorry, my Python is rusty from disuse, so maybe I got the syntax wrong. But something like that may help.

    Also, I can’t recall whether you need a pair of parentheses after the .Quit method. Try it like this just in case:

    objAccess.Application.Quit()
    

    In case objDB is still holding a reference to the Access application/db, delete it too.

    del objDB
    

    However, if you’re not actually using it elsewhere in your real code, just eliminate objDB altogether.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Found very strange behavior of MS Access database when running queries from c#. It
Preface: I have a MS Access 2010 front end running against a MySQL back
I'm running Mac OS X Snow Leopard and wan't to access the Display from
It is possible to access Exchange 2010 Addressbook from a PowerShell Script which is
We have a Sharepoint 2010 (Enterprise Client Access) server installed and running. I've tried
We have a job management application running (Access) with the database in SQL Server
I am running a subversion server with access via http using webdav. I have
I have the following Access 2002 query I'm running through OLE DB in .NET:
I'm getting this error when trying to access my webservice running inside tomcat. Caused
I'm running into a scenario where at random times I am getting Access Denied

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.