Beendigung des AddIns bei fehlerhafter Verbindung

This commit is contained in:
2022-11-07 16:19:27 +01:00
parent 5c8d8e4eb7
commit 566de3a883
2 changed files with 20 additions and 3 deletions

View File

@@ -5,6 +5,7 @@ Imports System.Reflection
Imports System.Windows.Forms
Imports Microsoft.Office.Core
Imports System.Dynamic
Imports SDL
'Option Private Module
'Imports Microsoft.Office.Core
@@ -27,6 +28,7 @@ Public Class ThisAddIn
inspectors = Me.Application.Inspectors
currentExplorer = Me.Application.ActiveExplorer
SharedExplorer = currentExplorer
checkConnection()
AddHandler VERAGRibbon.bla, Sub()
' MsgBox("JOAS")
@@ -173,6 +175,23 @@ Public Class ThisAddIn
' wdDoc.Close(False)
' wdApp.Quit()
End Sub
Public Sub checkConnection()
Dim con = New VERAG_PROG_ALLGEMEIN.SQL
If con.getValueTxtBySql("SELECT 1", "FMZOLL") <> 1 Then
MsgBox("ACHTUNG: Server nicht erreichbar!" & vbCrLf & "VERAG ADD In wird beendet")
Application.Quit()
End If
End Sub
End Class