MS Access opens minimized after running program which executes macros.

bmaupin

New member
Joined
Oct 13, 2009
Messages
1
Programming Experience
1-3
I have a program which uses an Access.Application object to run several macros in an Access 2000 Database. After running the program, the macros execute successfully but if I open Access, it opens minimized in the system tray and only the default database wizard window (with options to open existing or blank DB) opens up on the screen. If I right click the program in the system tray and select maximize it opens fine after that until I run my program again. I'm guessing that I may not be cleaning up the Access object correctly, but that is my only idea of where it is going wrong. This is the code I have to clean up the Access object. How can I get it to open normally after running this program?

VB.NET:
objAccess.DoCmd.Close(Access.AcObjectType.acTable, "STOCK_FOR_LABELS", Access.AcCloseSave.acSaveYes)
objAccess.CloseCurrentDatabase()
objAccess.Quit()
GC.Collect()
GC.WaitForPendingFinalizers()
Marshal.FinalReleaseComObject(objAccess)
GC.Collect()
objAccess = Nothing
 
Back
Top