HI firefytr,
I used this code, which is in Ozgrid's 'Hey tht is Cool' Forum, by lasw10. I attached this to the command button and it adds the reference before attempting to send the e-mail.
Dim ID As Variant
On Error Resume Next
'Reference ADO Object Library using Major / Minor GUID
Set ID = ThisWorkbook.VBProject.References
ID.AddFromGuid "{00062FFF-0000-0000-C000-000000000046}", 9, 0
It also supplied the code to find the GUID No if you don't know it. Click the Reference and then run this code:
Sub Grab_References()
Dim n As Integer
Sheets.Add
ActiveSheet.Name = "GUIDS"
On Error Resume Next
For n = 1 To ActiveWorkbook.VBProject.References.Count
Cells(n,1) = ActiveWorkbook.VBProject.References.Item(n).Name
Cells(n,2) = ActiveWorkbook.VBProject.References.Item(n).Description
Cells(n,3) = ActiveWorkbook.VBProject.References.Item(n).GUID
Cells(n,4) = ActiveWorkbook.VBProject.References.Item(n).Major
Cells(n,5) = ActiveWorkbook.VBProject.References.Item(n).Minor
Cells(n,6) = ActiveWorkbook.VBProject.References.Item(n).fullpath
Next n
End Sub
It appears to have solved my problem.
Thanks to you and Jacob for your time and patience.
Regards,
Bill