Hi,
I never said it was windows API - there are lots of other API's around

? (or maybe

right now... the other API's are usually for writing integration software between applications, which is what I deal with.
Here's the part of my code that fail - the trouble line in bold (sorry it's a lot):
Code for the form that fail once I've run the LoadLibraryStructure sub
General - Declarations:
'Variables for getting Notesobjects
Dim session As Object
Dim ws As Object
Dim uidb As Variant
Dim uiview As Variant
Dim view As Variant
Dim db As Variant
Dim collection As Variant
Dim uidoc As Variant
Dim doc As Variant
Dim theDocumentDatabase As Variant
Dim theNotesDocument As Variant
Dim theRichTextItem As Variant
Dim theCabinetDatabase As Variant
Dim binderLookupID As Variant
Dim binderEntry As Variant
Dim binderID As String
Dim subject As Variant
Dim namecount As Integer
Dim dbcount As Integer
Dim c As Integer
Dim viewID As String
Dim libNameMembers() As String
Dim libDbMembers() As String
Dim libDbUrlPath() As String
Dim serverurl As String
Dim servername As String
Dim slashpos As Integer
Dim libPath() As String
'function to center dialogs
Private Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
'Declare all api objects as Variants
Dim theApi As Object
Dim theLibrary As Object
Dim theRooms As Object
Dim theCabinets As Object
Dim theCategories As Object
Dim theBinders As Object
Dim theDocuments As Object
Dim theProfiles As Object
Dim theProfile As Object
Dim theCabinet As Object
Dim theBinder As Object
Dim theNewDocument As Object
'Additional properties to the form
Public UserName As String
Public Password As String
Public HostDocHandle As HostDocHandle
Public LoginFailed As Long
'variables for building table for structure display
Private Type RoomInfo
type As String
theRooms As Variant
roomTitle As String
roomIndex As Integer
End Type
Dim Rooms() As RoomInfo
Private Type CabinetInfo
type As String
theCabinets As Variant
cabinetTitle As String
cabinetIndex As Integer
parentRoomTitle As String
parentRoomIndex As Integer
End Type
Dim Cabinets() As CabinetInfo
Private Type CategoryInfo
type As String
theCategories As Variant
categoryTitle As String
categoryIndex As Integer
parentCabinetTitle As String
parentCabinetIndex As Integer
parentRoomTitle As String
parentRoomIndex As Integer
End Type
Dim Categories() As CategoryInfo
Private Type BinderInfo
type As String
theBinders As Variant
binderTitle As String
binderIndex As Integer
parentCategoryTitle As String
parentCategoryIndex As Integer
parentCabinetTitle As String
parentCabinetIndex As Integer
parentRoomTitle As String
parentRoomIndex As Integer
End Type
Dim Binders() As BinderInfo
Private Type DocumentInfo
type As String
theDocuments As Variant
documentTitle As String
documentIndex As Integer
parentBinderTitle As String
parentBinderIndex As Integer
parentCategoryTitle As String
parentCategoryIndex As Integer
parentCabinetTitle As String
parentCabinetIndex As Integer
parentRoomTitle As String
parentRoomIndex As Integer
End Type
Dim Documents() As DocumentInfo
Private Type DocumentTypes
CabinetName As String
DocTypeName As String
End Type
Dim doctypes() As DocumentTypes
Private Type Buffer
Name As String
type As String
Index As Integer
End Type
'Dim theBinders() As Variant
'Dim theDocuments() As Variant
Dim NumberOfRooms As Integer
Dim NumberOfCabinets As Integer
Dim NumberOfCategories As Integer
Dim NumberOfBinders As Integer
Dim NumberOfDocuments As Integer
Dim maxRooms As Integer
Dim maxCabinets As Integer
Dim maxCategories As Integer
Dim maxBinders As Integer
Dim maxDocuments As Integer
Dim libraryName As String
Dim roomNames() As String
Dim cabNames() As String
Dim categoryNames() As String
Dim binderNames() As String
Dim documentNames() As String
'Declare Array
Dim listArray(1, 1, 1, 1, 1) As String
Dim nodeitem As Node
Dim nodekey As String
Dim nodetext As String
Dim selectednode As Node
Public Sub LoadLibraryStructure()
On Error GoTo LoadLibError
'----------------
Me.MousePointer = vbHourglass
Me.StartText1.Visible = 0
Me.StartText2(0).Visible = 0
Me.StartText3(1).Visible = 0
Me.StartText4.Visible = 0
Me.StartText5.Visible = 0
Me.StartText6.Visible = 0
Me.StartText7.Visible = 0
Me.Progress1.Visible = 1
Me.Progress2.Visible = 1
pgteller = 10
Me.Progress1.Value = pgteller
pgteller2 = 1
Me.Progress2.Value = pgteller2
Me.Label1.Caption = "Retrieving Domino.doc Rooms: "
Me.Label1.Visible = 1
'---------------
Me.Refresh
ReDim Rooms(0)
ReDim Cabinets(0)
ReDim Categories(0)
ReDim Binders(0)
ReDim Documents(0)
ReDim doctypes(0)
'MsgBox "Starting to grap theAPI"
'Create the Api object
Set theApi = CreateObject("DominoDoc.API"

'MsgBox "theApi is set"
pgteller2 = 5
Me.Progress2.Value = pgteller2
'MsgBox "Progressbar set to 5, login is next"
Call theApi.SetHttpLogin(Me.UserName, Me.Password)
'MsgBox "Have set login with an API method"
pgteller2 = 10
Me.Progress2.Value = pgteller2
'MsgBox "Updated progressbar, will grab lib object"
'Get the Library object from the Api
Set theLibrary = theApi.GetLibrary(Me.OpenLib.Text)
'MsgBox "Have grabbed lib object"
pgteller2 = 15
Me.Progress2.Value = pgteller2
'MsgBox "Updated progressbar, will grab throoms"
'Objects to clear: theAPI,theLibrary
'Get the Rooms from the library
'Redim theRooms(theLibrary.Rooms.Count)
Set theRooms = theLibrary.Rooms
'MsgBox "grabbed theRooms, will run therooms.count"
' GoTo LoadLibError
maxRooms = 0
maxRooms = theRooms.Count
' GoTo DebugJump1
'debug - release theRooms object and recreate it
Call theRooms.UncacheRoomsAndCabinets
Set theRooms = Nothing
Set theRooms = theLibrary.Rooms
' MsgBox "executed resetting theRooms object after count method called"
'end debugcode
'MsgBox "Have grabbed theRooms.Count"
Do While maxRooms = 0
MsgBox "still not done getting rooms count"
Loop
NumberOfRooms = maxRooms
Erase Rooms
ReDim Rooms(NumberOfRooms - 1)
For a = 0 To NumberOfRooms - 1
'MsgBox "Assigning first room to Rooms array"
Set Rooms(a).theRooms = theRooms.ItemByIndex(a)
Rooms(a).roomTitle = Rooms(a).theRooms.Title
Rooms(a).roomIndex = a
Rooms(a).type = "Room"
pgteller2 = Round((90 / NumberOfRooms), 0) + pgteller2
Me.Progress2.Value = pgteller2
Next
pgteller = 20
pgteller2 = 130
Me.Progress1.Value = pgteller
Me.Progress2.Value = pgteller2
Me.Label1.Caption = "Retrieving Domino.doc Cabinets: "
Me.Refresh
'Objects to clear: theRooms,Rooms

.theRooms
'Get the Cabinets object from the Rooms
NumberOfCabinets = 0
maxCabinets = 0
c = 0
pgteller2 = 10
Me.Progress2.Value = pgteller2
g = 0
Erase Cabinets
For a = 0 To NumberOfRooms - 1
'MsgBox "Grabbing the Cabinets of the room"
Set theCabinets = Rooms(a).theRooms.Cabinets
NumberOfCabinets = NumberOfCabinets + theCabinets.Count
ReDim Preserve Cabinets(NumberOfCabinets - 1)
For b = 0 To theCabinets.Count - 1
'MsgBox "Assigning first cabinet to Cabinets array"
Set Cabinets(c).theCabinets = theCabinets.ItemByIndex(b)
Cabinets(c).cabinetTitle = Cabinets(c).theCabinets.Title
Cabinets(c).cabinetIndex = c
Cabinets(c).parentRoomTitle = Rooms(a).theRooms.Title
Cabinets(c).parentRoomIndex = a
Cabinets(c).type = "Cabinet"
'MsgBox "grabbing theProfiles"
Set theProfiles = Cabinets(c).theCabinets.DocumentProfiles
If Not (theProfiles Is Nothing) Then
Erase doctypes
For m = 0 To theProfiles.Count - 1
'MsgBox "Getting profile from theProfiles"
Set theProfile = theProfiles.ItemByIndex(m)
ReDim Preserve doctypes(g)
doctypes(g).CabinetName = Cabinets(c).cabinetTitle
doctypes(g).DocTypeName = theProfile.Name
g = g + 1
Next
End If
'MsgBox "using theCabinets.Count method twice"
If theCabinets.Count > maxCabinets Then
maxCabinets = theCabinets.Count
End If
c = c + 1
pgteller2 = Round((90 / NumberOfRooms), 0) + pgteller2
Me.Progress2.Value = pgteller2
Next
Next
pgteller = 35
Me.Progress1.Value = pgteller
pgteller2 = 130
Me.Progress2.Value = pgteller2
'Objects to clear: theCabinets,Cabinets

.theCabinets,theProfiles,theProfile
Me.Label1.Caption = "Retrieving Domino.doc Categories: "
Me.Refresh
'Get the Binders from the Cabinets
NumberOfCategories = 0
maxCategories = 0
c = 0
pgteller2 = 10
Me.Progress2.Value = pgteller2
Erase Categories
For a = 0 To NumberOfCabinets - 1
Set theCategories = Cabinets(a).theCabinets.Categories
NumberOfCategories = NumberOfCategories + theCategories.Count
ReDim Preserve Categories(NumberOfCategories - 1)
For b = 0 To theCategories.Count - 1
Set Categories(c).theCategories = theCategories.ItemByIndex(b)
Categories(c).categoryTitle = Categories(c).theCategories.Title
Categories(c).categoryIndex = c
Categories(c).parentCabinetTitle = Cabinets(a).theCabinets.Title
Categories(c).parentCabinetIndex = a
Categories(c).type = "Category"
If theCategories.Count > maxCategories Then
maxCategories = theCategories.Count
End If
c = c + 1
Next
pgteller2 = Round((90 / NumberOfCabinets), 0) + pgteller2
Me.Progress2.Value = pgteller2
Next
pgteller = 60
Me.Progress1.Value = pgteller
pgteller2 = 130
Me.Progress2.Value = pgteller2
'Redim Preserve theBinders(NumberOfBinders)
'Objects to clear: theCategories, Categories

.theCategories
Me.Label1.Caption = "Retrieving Domino.doc Binders: "
Me.Refresh
'Get the Binders from the Cabinets
NumberOfBinders = 0
maxBinders = 0
c = 0
pgteller2 = 10
Me.Progress2.Value = pgteller2
Erase Binders
For a = 0 To NumberOfCategories - 1
Set theBinders = Categories(a).theCategories.Binders
NumberOfBinders = NumberOfBinders + theBinders.Count
ReDim Preserve Binders(NumberOfBinders - 1)
For b = 0 To theBinders.Count - 1
Set Binders(c).theBinders = theBinders.ItemByIndex(b)
Binders(c).binderTitle = Binders(c).theBinders.Title
Binders(c).binderIndex = c
Binders(c).parentCategoryTitle = Categories(a).theCategories.Title
Binders(c).parentCategoryIndex = a
Binders(c).parentCabinetTitle = Categories(a).parentCabinetTitle
Binders(c).parentCabinetIndex = Categories(a).parentCabinetIndex
Binders(c).type = "Binder"
If theBinders.Count > maxBinders Then
maxBinders = theBinders.Count
End If
c = c + 1
Next
pgteller2 = Round((90 / NumberOfCategories), 0) + pgteller2
Me.Progress2.Value = pgteller2
Next
pgteller = 60
Me.Progress1.Value = pgteller
pgteller2 = 130
Me.Progress2.Value = pgteller2
'Objects to Clear: theBinders, Binders

.theBinders
'START FOR CODE TO ACTIVATE WHEN NEEDINT TO DISPLAY DOCUMENTS IN TREEVIEW
' Me.Label1.Caption = "Retrieving Domino.doc Documents: "
' Me.Refresh
'Get the Documets from the Binders
' NumberOfDocuments = 0
' maxDocuments = 0
' c = 0
' pgteller2 = 10
' Me.Progress2.Value = pgteller2
' Erase Documents
' For a = 0 To NumberOfBinders - 1
' set theDocuments = Binders(a).theBinders.Documents
' NumberOfDocuments = NumberOfDocuments + theDocuments.Count
' If NumberOfDocuments > 0 Then
' ReDim Preserve Documents(NumberOfDocuments - 1)
' End If
' For b = 0 To theDocuments.Count - 1
' Set Documents(c).theDocuments = theDocuments.ItemByIndex(b)
' Documents(c).documentTitle = Documents(c).theDocuments.Title
' Documents(c).documentIndex = c
' Documents(c).parentBinderTitle = Binders(a).theBinders.Title
' Documents(c).parentBinderIndex = a
' Documents(c).parentCategoryTitle = Binders(a).parentCategoryTitle
' Documents(c).parentCategoryIndex = Binders(a).parentCategoryIndex
' Documents(c).parentCabinetTitle = Binders(a).parentCabinetTitle
' Documents(c).parentCabinetIndex = Binders(a).parentCabinetIndex
' Documents(c).parentRoomTitle = Cabinets(Documents(c).parentCabinetIndex).parentRoomTitle
' Documents(c).parentRoomIndex = Cabinets(Documents(c).parentCabinetIndex).parentRoomIndex
' Documents(c).type = "Document"
' If theDocuments.Count > maxDocuments Then
' maxDocuments = theDocuments.Count
' End If
' c = c + 1
' Next
' pgteller2 = Round((98 / NumberOfBinders), 0) + pgteller2
' Me.Progress2.Value = pgteller2
' Next
' Call theDocuments.Uncache
' Set theDocuments = Nothing
' pgteller2 = 130
' Me.Progress2.Value = pgteller2
' pgteller = 95
' Me.Progress1.Value = pgteller
' Me.Label1.Caption = "Done"
' pgteller2 = 1
'END CODE TO GRAB THE DOCUMENTS FOR PUTTING IN THE DISPLAY
c = 0
Me.Progress2.Visible = 0
Me.Progress1.Value = 100
stopWatch = Timer
While ((Timer - stopWatch) < 1)
Wend
Me.Progress1.Visible = 0
Me.Label1.Visible = 0
' GoTo DebugJump1
'Building the nodes for the Treeview control
nodekey = "Lib"
If Me.OpenLib.Text = "
Then
nodetext = "HTP Library"
Else
nodetext = theLibrary.Database
End If
nodeimage = "library"
parentkey = ""
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(, , nodekey, nodetext, nodeimage)
nodeitem.Expanded = True
For a = 0 To NumberOfRooms - 1
nodekey = Rooms(a).type & Rooms(a).roomIndex
nodetext = Rooms(a).roomTitle
nodeimage = "fileroom"
parentkey = "Lib"
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(parentkey, tvwChild, nodekey, nodetext, nodeimage)
nodeitem.Expanded = False
roomkey = nodekey
For d = 0 To NumberOfCabinets - 1
parentkey = roomkey
If Cabinets(d).parentRoomTitle = Rooms(a).roomTitle Then
nodekey = Cabinets(d).type & Cabinets(d).cabinetIndex
nodetext = Cabinets(d).cabinetTitle
nodeimage = "cabinet"
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(parentkey, tvwChild, nodekey, nodetext, nodeimage)
nodeitem.Expanded = False
cabkey = nodekey
For e = 0 To NumberOfCategories - 1
parentkey = cabkey
If Categories(e).parentCabinetTitle = Cabinets(d).cabinetTitle Then
nodekey = Categories(e).type & Categories(e).categoryIndex
If Not (Categories(e).categoryTitle = ""

Then
nodetext = Categories(e).categoryTitle
Else
nodetext = "Not Categorized"
End If
nodeimage = "category"
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(parentkey, tvwChild, nodekey, nodetext, nodeimage)
nodeitem.Expanded = False
catkey = nodekey
For f = 0 To NumberOfBinders - 1
parentkey = catkey
If Binders(f).parentCategoryTitle = Categories(e).categoryTitle Then
nodekey = Binders(f).type & Binders(f).binderIndex
nodetext = Binders(f).binderTitle
nodeimage = "binder"
Set nodeitem = Me.LibStructureTreeView.Nodes.Add(parentkey, tvwChild, nodekey, nodetext, nodeimage)
nodeitem.Expanded = False
End If
Next
End If
Next
End If
Next
Next
firstcab = doctypes(0).CabinetName
For z = 0 To UBound(doctypes)
If doctypes(z).CabinetName = firstcab Then
Me.DocType.AddItem doctypes(z).DocTypeName, z
End If
Next
DebugJump1:
'kill the objects not needed when loaded
'API & library
LoginDomdoc.LoginSucceeded = True
'objects in userdefined datatypes
'Clear the collection objects used for counts
If Not (theBinders Is Nothing) Then
If theBinders.IsCached = True Then
' MsgBox "Binders Is Cached"
End If
For z = 0 To UBound(Binders)
Set Binders(z).theBinders = Nothing
Next
Erase Binders
' Set theBinders = Nothing
End If
If Not (theCategories Is Nothing) Then
For z = 0 To UBound(Categories)
Set Categories(z).theCategories = Nothing
Next
Erase Categories
Set theCategories = Nothing
End If
If Not (theProfiles Is Nothing) Then
If theProfiles.IsCached = True Then
Call theProfiles.Uncache
End If
Set theProfiles = Nothing
Set theProfile = Nothing
End If
If Not (theCabinets Is Nothing) Then
Set theCabinets = Nothing
For z = 0 To UBound(Cabinets)
Set Cabinets(z).theCabinets = Nothing
Next
Erase Cabinets
End If
'Clear the memory of DDocAPI cached objects
If Not theRooms Is Nothing Then
If theRooms.IsCached = True Then
Call theRooms.UncacheRoomsAndCabinets
End If
For z = 0 To UBound(Rooms)
Set Rooms(z).theRooms = Nothing
Next
Erase Rooms
Set theRooms = Nothing
End If
If Not (theBinders Is Nothing) Then
If theBinders.IsValid = True Then
MsgBox "Binders Is still Cached"
End If
Set theBinders = Nothing
End If
Set theLibrary = Nothing
Set theApi = Nothing
Me.DocType.Text = Me.DocType.List(0)
Me.Height = 9600
Me.LibStructureTreeView.Visible = True
Me.DocTitleLabel.Visible = True
Me.Title.Visible = True
Me.DocTypeLabel.Visible = True
Me.DocType.Visible = True
Me.DocIDLabel.Visible = True
Me.DocID.Visible = True
Me.AttachmentsOnly.Visible = True
Me.CompoundDoc.Visible = True
Me.NumGen.Visible = True
Me.DocFrame.Visible = True
Me.MapFrame.Visible = True
Me.EditProperties.Visible = True
Me.MapFields.Visible = True
Me.TransferProperties.Visible = True
Me.PresetMapConfig.Visible = True
Me.ShowMapping.Visible = True
Me.Save.Enabled = True
Me.MousePointer = vbDefault
' Me.Title.SetFocus
Me.Refresh
Exit Sub
LoadLibError:
If Err.Number = 40007 Then
If Me.LoginFailed < 3 Then
Err.Clear
Me.LoginFailed = Me.LoginFailed + 1
MsgBox "Access Denied. Check your username and password and try again or cancel"
If Not (theRooms Is Nothing) Then
Call theRooms.UncacheRoomsAndCabinets
Set theRooms = Nothing
End If
Set theLibrary = Nothing
Set theApi = Nothing
'MsgBox "have killed theAPI and theLibrary, resetting progressbar"
pgteller2 = 5
Me.Progress2.Value = pgteller2
Me.Label1.Caption = "Ready"
'MsgBox "progress reset,setting loginsuccess boolean"
LoginDomdoc.LoginSucceeded = True
'MsgBox "giving control back to login box"
LoginDomdoc.Show
Exit Sub
Else
MsgBox "Access Denied. Terminating program"
Err.Clear
Set HostDoc = Nothing
'objects in userdefined datatypes
For z = 0 To UBound(Binders)
Set Binders(z).theBinders = Nothing
Next
Erase Binders
'Clear the collection objects used for counts
If Not (theBinders Is Nothing) Then
If theBinders.IsCached = True Then
MsgBox "Binders Is Cached"
End If
' Set theBinders = Nothing
End If
For z = 0 To UBound(Categories)
Set Categories(z).theCategories = Nothing
Next
Set theProfile = Nothing
Erase Categories
If Not (theProfiles Is Nothing) Then
If theProfiles.IsCached = True Then
Call theProfiles.Uncache
End If
Set theProfiles = Nothing
End If
Set theCategories = Nothing
For z = 0 To UBound(Cabinets)
Set Cabinets(z).theCabinets = Nothing
Next
Erase Cabinets
If Not (theCabinets Is Nothing) Then
Set theCabinets = Nothing
End If
'Clear the memory of DDocAPI cached objects
For z = 0 To UBound(Rooms)
Set Rooms(z).theRooms = Nothing
Next
Erase Rooms
If Not theRooms Is Nothing Then
If theRooms.IsCached = True Then
Call theRooms.UncacheRoomsAndCabinets
End If
Set theRooms = Nothing
End If
If Not (theBinders Is Nothing) Then
If theBinders.IsValid = True Then
MsgBox "Binders Is still Cached"
End If
Set theBinders = Nothing
End If
Set theLibrary = Nothing
Set theApi = Nothing
LoginDomdoc.LoginSucceeded = False
Unload Me
Exit Sub
End If
Else
MsgBox "Error " & CStr(Err.Number) & ". " & Err.Description
Set nodeitem = Nothing
For Each Node In LibStructureTreeView.Nodes
Set Node = Nothing
Next Node
Erase doctypes
'objects in userdefined datatypes
For z = 0 To UBound(Binders)
Set Binders(z).theBinders = Nothing
Next
Erase Binders
'Clear the collection objects used for counts
If Not (theBinders Is Nothing) Then
If theBinders.IsCached = True Then
MsgBox "Binders Is Cached"
End If
' Set theBinders = Nothing
End If
For z = 0 To UBound(Categories)
Set Categories(z).theCategories = Nothing
Next
Set theProfile = Nothing
Erase Categories
If Not (theProfiles Is Nothing) Then
If theProfiles.IsCached = True Then
Call theProfiles.Uncache
End If
Set theProfiles = Nothing
End If
Set theCategories = Nothing
For z = 0 To UBound(Cabinets)
Set Cabinets(z).theCabinets = Nothing
Next
Erase Cabinets
If Not (theCabinets Is Nothing) Then
Set theCabinets = Nothing
End If
'Clear the memory of DDocAPI cached objects
For z = 0 To UBound(Rooms)
Set Rooms(z).theRooms = Nothing
Next
Erase Rooms
If Not theRooms Is Nothing Then
If theRooms.IsCached = True Then
Call theRooms.UncacheRoomsAndCabinets
End If
Set theRooms = Nothing
End If
If Not (theBinders Is Nothing) Then
If theBinders.IsValid = True Then
MsgBox "Binders Is still Cached"
End If
Set theBinders = Nothing
End If
Set theLibrary = Nothing
Set theApi = Nothing
LoginDomdoc.LoginSucceeded = False
Unload SaveDialog
Unload Me
Exit Sub
End If
End Sub
Private Sub Cancel_Click()
' Call Me.ShutDown
Set HostDoc = Nothing
' Me.HostDocHandle = Nothing
' Me.UserName = ""
' Me.Password = ""
' Set theProfiles = Nothing
' Set theProfile = Nothing
Set nodeitem = Nothing
For Each Node In LibStructureTreeView.Nodes
Set Node = Nothing
Next Node
' Erase doctypes
Unload LoginDomdoc
' Unload Me
' Set SaveDialog = Nothing
Unload SaveDialog
Set SaveDialog = Nothing
Unload Me
' End
End Sub
LoginDomdoc - form code:
Option Explicit
Public LoginSucceeded As Boolean
Private Sub cmdCancel_Click()
'set the global var to false
'to denote a failed login
LoginSucceeded = False
Me.Hide
End Sub
Private Sub cmdOK_Click()
'MsgBox "setting username"
SaveDialog.UserName = Me.UserNameInput
'MsgBox "setting password"
SaveDialog.Password = Me.PasswordInput
Me.Hide
' Unload Me
'MsgBox "giving control to save dialog"
Call SaveDialog.LoadLibraryStructure
If Me.LoginSucceeded = False Then
Unload SaveDialog
Unload Me
End If
End Sub