S
Sharlene England
I have written a simple macro which uses a 'public' folder to populate the
contents of a userform combobox as below (this was written with the help of
"Veign"). I have made this into a .dot (template) and changed the file
location of the startup folder, on the two different machines where I tested
this. On both of my test machines, the macro exists, and I can run it.
But, on both machines the hour glass appears and then goes away and my form
never shows up. This works perfectly on the design machine. Even using the
..dot template. What is missing on the client machines? Any help would be
greatly appreciated.
Sincerely,
Sharlene England
Vernon, BC
- - - -- - the following is the macro in question
On Error GoTo Hell
Dim CNN As Connection
Set CNN = New Connection
Dim RS As Recordset
Set RS = New Recordset
'Open a connection to Outlook
CNN.Open "Provider=Microsoft.JET.OLEDB.4.0;" & _
"Exchange 4.0;" & _
"MAPILEVEL=Outlook Address Book\;" & _
"PROFILE=Outlook;" & _
"TABLETYPE=1;" & _
"DATABASE=c:\temp" 'You may need to change this
'Open a recordset for the contacts
'will never be 100
With RS
.Open "SELECT * FROM [Signatures]", CNN, adOpenStatic, adLockReadOnly
.MoveFirst
'Loop through the Contacts
counter = 0
Do Until RS.EOF
carray(counter) = RS("First").Value & " " & RS("Last").Value
outputarray(counter, 1) = RS("Display name").Value
outputarray(counter, 2) = RS("Title").Value
outputarray(counter, 3) = RS("Company").Value
counter = counter + 1
.MoveNext
Loop
End With
'Now show the form with the populate array
Load UserForm1
UserForm1.ListBox1.List = carray()
UserForm1.Show
Exit_For:
'Cleanup
If RS.State = adStateOpen Then RS.Close
Set RS = Nothing
If CNN.State = adStateOpen Then CNN.Close
Set RS = Nothing
Exit Sub
Hell:
GoTo Exit_For
contents of a userform combobox as below (this was written with the help of
"Veign"). I have made this into a .dot (template) and changed the file
location of the startup folder, on the two different machines where I tested
this. On both of my test machines, the macro exists, and I can run it.
But, on both machines the hour glass appears and then goes away and my form
never shows up. This works perfectly on the design machine. Even using the
..dot template. What is missing on the client machines? Any help would be
greatly appreciated.
Sincerely,
Sharlene England
Vernon, BC
- - - -- - the following is the macro in question
On Error GoTo Hell
Dim CNN As Connection
Set CNN = New Connection
Dim RS As Recordset
Set RS = New Recordset
'Open a connection to Outlook
CNN.Open "Provider=Microsoft.JET.OLEDB.4.0;" & _
"Exchange 4.0;" & _
"MAPILEVEL=Outlook Address Book\;" & _
"PROFILE=Outlook;" & _
"TABLETYPE=1;" & _
"DATABASE=c:\temp" 'You may need to change this
'Open a recordset for the contacts
'will never be 100
With RS
.Open "SELECT * FROM [Signatures]", CNN, adOpenStatic, adLockReadOnly
.MoveFirst
'Loop through the Contacts
counter = 0
Do Until RS.EOF
carray(counter) = RS("First").Value & " " & RS("Last").Value
outputarray(counter, 1) = RS("Display name").Value
outputarray(counter, 2) = RS("Title").Value
outputarray(counter, 3) = RS("Company").Value
counter = counter + 1
.MoveNext
Loop
End With
'Now show the form with the populate array
Load UserForm1
UserForm1.ListBox1.List = carray()
UserForm1.Show
Exit_For:
'Cleanup
If RS.State = adStateOpen Then RS.Close
Set RS = Nothing
If CNN.State = adStateOpen Then CNN.Close
Set RS = Nothing
Exit Sub
Hell:
GoTo Exit_For