diff options
author | Jean-Pierre Ledure <jp@ledure.be> | 2017-11-16 16:15:05 +0100 |
---|---|---|
committer | Jean-Pierre Ledure <jp@ledure.be> | 2017-11-16 16:15:05 +0100 |
commit | fa7f2ec536b477acb6ba2cc1ec42b7f6ec97a024 (patch) | |
tree | e57a81c7351d0e7a62b61bf7f9f9e3bf17c1a635 | |
parent | 359286b90f4d9962a3c1cb936ac7fd4140f71baa (diff) |
Access2Base - FIX AllDialogs() should run when no active document
Stopped erroneously with error message "No active connection"
-rw-r--r-- | wizards/source/access2base/Application.xba | 11 | ||||
-rw-r--r-- | wizards/source/access2base/Root_.xba | 2 |
2 files changed, 10 insertions, 3 deletions
diff --git a/wizards/source/access2base/Application.xba b/wizards/source/access2base/Application.xba index 13b97fda0927..611bfde517d6 100644 --- a/wizards/source/access2base/Application.xba +++ b/wizards/source/access2base/Application.xba @@ -195,6 +195,7 @@ Dim iMode As Integer, vDialogs() As Variant, i As Integer, j As Integer, iCount Dim oMacLibraries As Object, vAllDialogs As Variant, oLibrary As Object, vNames() As Variant, bFound As Boolean Dim oLibDialog As Object, sLibrary As String, oDocLibraries As Object, bLocalStorage As Boolean Dim vLibraries() As Variant, vMacLibraries() As Variant, vDocLibraries() As Variant, oDocMacLib As Object +Dim vCurrentDocument As Variant Const cstCount = 0 Const cstByIndex = 1 Const cstByName = 2 @@ -209,8 +210,14 @@ Const cstSepar = "!" Set vAllDialogs = Nothing - Set oDocLibraries = _A2B_.CurrentDocument.Document.DialogLibraries ' ThisComponent.DialogLibraries - vDocLibraries = oDocLibraries.getElementNames() + Set vCurrentDocument = _A2B_.CurrentDocument + If IsNull(vCurrentDocument) Then + Set oDocLibraries = Nothing + vDocLibraries = Array() + Else + Set oDocLibraries = _A2B_.CurrentDocument.Document.DialogLibraries ' ThisComponent.DialogLibraries + vDocLibraries = oDocLibraries.getElementNames() + End If Set oMacLibraries = DialogLibraries vMacLibraries = oMacLibraries.getElementNames() 'Remove Access2Base from the list diff --git a/wizards/source/access2base/Root_.xba b/wizards/source/access2base/Root_.xba index 01f50923b6cd..a95fe87ca1f3 100644 --- a/wizards/source/access2base/Root_.xba +++ b/wizards/source/access2base/Root_.xba @@ -202,7 +202,7 @@ Public Function CurrentDocument(ByVal Optional piDocIndex As Integer) As Variant ' Returns the CurrentDoc(...) referring to the current document or to the argument Dim iDocIndex As Integer - If IsMissing(piDocIndex) Then iDocIndex = CurrentDocIndex() Else iDocIndex = piDocIndex + If IsMissing(piDocIndex) Then iDocIndex = CurrentDocIndex(, False) Else iDocIndex = piDocIndex If iDocIndex >= 0 And iDocIndex <= UBound(CurrentDoc) Then Set CurrentDocument = CurrentDoc(iDocIndex) Else Set CurrentDocument = Nothing End Function |