以前にこれがあったことは知っていますが、それを回避する方法を思い出せません。
1 つのことを除けば、正常に動作するマネージ コード アドインを作成しました。Access アプリケーションを閉じようとしても、タスクを終了しない限り、アプリケーション ウィンドウは引き続き表示されます。Visual Studio 2010 を使用してアドインをデバッグしているときに、デバッグを停止すると正常に終了します。
on disconnect イベントの一部として、すべての変数を何も設定していません。
Public Sub OnDisconnection(ByVal RemoveMode As Extensibility.ext_DisconnectMode, ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnDisconnection
'On Error Resume Next
If Not MenuCommandControls Is Nothing Then MenuCommandControls.Delete()
If Not MenuCommandDimensionVariable Is Nothing Then MenuCommandDimensionVariable.Delete()
If Not MenuCommandFields Is Nothing Then MenuCommandFields.Delete()
If Not MenuCommandForms Is Nothing Then MenuCommandForms.Delete()
If Not MenuCommandParseSQL Is Nothing Then MenuCommandParseSQL.Delete()
If Not MenuCommandQueries Is Nothing Then MenuCommandQueries.Delete()
If Not MenuCommandReports Is Nothing Then MenuCommandReports.Delete()
If Not MenuCommandTables Is Nothing Then MenuCommandTables.Delete()
If Not MenuCommandVariables Is Nothing Then MenuCommandVariables.Delete()
If Not searchForm Is Nothing Then searchForm.Close() : searchForm = Nothing
If Not ObjectSetting Is Nothing Then ObjectSetting = Nothing
If Not AccessInst Is Nothing Then AccessInst = Nothing
If Not addInInstance Is Nothing Then addInInstance = Nothing
'If Not FormParseSQL Is Nothing Then FormParseSQL = Nothing
applicationObject.Quit(Access.AcQuitOption.acQuitPrompt)
If Not applicationObject Is Nothing Then applicationObject = Nothing
End Sub