Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to close Access from Excel?

Status
Not open for further replies.
Dec 23, 2004
33
US
I use this code from this forum to open my access database from Excel. The macro "CombineData" is called to update its table. It works fine but the problem I have is the database does not close after it completes. When I am in access, it said the database is locked. I have to close out the window and to log back in to have it goes away. How do I fix the problem? Thanks.

----------
Sub Appendto_To_Table()

Set dbTriAuto = CreateObject("Access.Application")

dbTriAuto_OpenCurrentDatabase (DataBasePathName)
dbTriAuto.DoCmd.SetWarnings False
dbTriAuto.DoCmd.RunMacro "CombineData"

End Sub
 
You may add this line before the End Sub:
dbTriAuto.Quit

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top