Using the VS2005 shared add-in template, I cast the application object to Microsoft.Office.Interop.Access.Application and use the CurrentProject property to get the name of the currently open Access Project. All works fine until I close MSAccess - it disappears
but is not unloaded (still in task list), and subsequent attempts to run MSAccess fail until the previous process instance is cancelled. // cast application object
applicationObject = (Access.
// from add-in action (say button.onClick)
string str = applicationObject.CurrentProject.ToString();
if I don't use any of the 'project' or 'data' properties of the applicationObject, MSaccess closes ok (adding command bars etc works fine), but even though references to CurrentProject work ok (return correct values), using them stops MSAccess from unloading.
I've seen other posts to newsgoups about this behaviour, but no resolution.
Any help appreciated.
-
-
ok, solved this one...
Need to declare each object as a new variable - compound statements like :
string str = applicationObject.CurrentProject.Name;
create hidden objects that do not have their reference count decremented during the normal garbage collection process, preventing the app from closing.
Thank you to knowledge base article 317109
Thread Closed
This thread is kinda stale and has been closed but if you'd like to continue the conversation, please create a new thread in our Forums,
or Contact Us and let us know.