Hello,

I have a issue with this code by one of my employees.

I have used this code to send e-mail via Excel.
Sub SendEmailUsingCOM() 
     
     '*******************************************************************************************
     ' Unlike OLE automation, one can use Early Binding while using COM
     ' To do so, replace the generic "object" by "commented" UDT
     ' Set reference to: Lotus Domino Objects
     '*******************************************************************************************
    Dim nSess       As Object 'NotesSession
    Dim nDir        As Object 'NotesDbDirectory
    Dim nDb         As Object 'NotesDatabase
    Dim nDoc        As Object 'NotesDocument
    Dim nAtt        As Object 'NotesRichTextItem
    Dim vToList     As Variant, vCCList As Variant, vBody As Variant 
    Dim vbAtt       As VbMsgBoxResult 
    Dim sFilPath    As String 
    Dim sPwd        As String 
     
     '*******************************************************************************************
     'To create notesession using COM objects, you can do so by using.
     'either ProgID  = Lotus.NotesSession
     'or     ClsID   = {29131539-2EED-1069-BF5D-00DD011186B7}
     'Replace ProgID by the commented string below.
     '*******************************************************************************************
    Set nSess = CreateObject("Lotus.NotesSession") 'New:{29131539-2EED-1069-BF5D-00DD011186B7}
     
     '*******************************************************************************************
     'This part initializes the session and creates a new mail document
     '*******************************************************************************************
    sPwd = Application.InputBox("Type your Lotus Notes password!", Type:=2) 
    Call nSess.Initialize(sPwd) 
    Set nDir = nSess.GetDbDirectory("") 
    Set nDb = nDir.OpenMailDatabase 
    Set nDoc = nDb.CreateDocument 
     
     '*******************************************************************************************
     'If you want to send it to multiple recipients then use variant array to get the names from
     'the specified range as below
     'Add / Remove Comment mark from vCCList as per your needs.
     '*******************************************************************************************
    vToList = Application.Transpose(Range("A1").Resize(Range("A" & Rows.Count).End(xlUp).Row).Value) 
    vCCList = Application.Transpose(Range("B1").Resize(Range("B" & Rows.Count).End(xlUp).Row).Value) 
     
     '*******************************************************************************************
     'If you want to send it to multiple recipients then use variant array to get the names from
     'the specified range as below
     'Add / Remove Comment mark from vCCList as per your needs.
     '*******************************************************************************************
    With nDoc 
         
        Set nAtt = .CreateRichTextItem("Body") 
        Call .ReplaceItemValue("Form", "Memo") 
        Call .ReplaceItemValue("Subject", "Test Lotus Notes Email using COM") 
         
        With nAtt 
            .AppendText (Range("C2").Value) 
             
             'Decide if you want to attach a file.
            vbAtt = MsgBox("Do you want to attach document?", vbYesNo, "Attach Document") 
             
            Select Case vbAtt 
            Case 6 
                .AddNewLine 
                .AppendText ("********************************************************************") 
                .AddNewLine 
                sFilPath = Application.GetOpenFilename 
                Call .EmbedObject(1454, "", sFilPath) '1454 = Constant for EMBED_ATTACHMENT
            Case 7 
                 'Do Nothing
            End Select 
             
        End With 
         
        Call .ReplaceItemValue("CopyTo", vCCList) 
        Call .ReplaceItemValue("PostedDate", Now()) 
        Call .Send(False, vToList) 
         
    End With 
     
End Sub 
After the employee enter his password to LotusNotes he is getting a Object error -2######.

New Picture.jpg

I don't know where the issue can be?

Thank you for any help,