My startup group

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
 
S

Sharlene England

I have the following 3 libraries included:



Microsoft Office 11.0 Object Library

Microsoft ActiveX Data Objects 2.0 Library

Microsoft Forms 2.0 Objects Library



when I added the ado.connection I got an error which said.



Compile Error

User defined type not defined.



Please help, thank you.
 
S

Sharlene England

It is now working.

All that I had to do was check the box that says 'show this folder as an
email address book' in outlook.

Thanks for all of the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top