• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Mail Sending to Lotus From VBA Form

Hi,
I am working with the code sends the a mail to lotus notes. The code is working fine for me when I am working on wth my system... i am using win 7 and excel 2007... But, when i worked with the other system with the same configuration I got an error as "Can't find project or library" and i found the reference which was mentioning as Missing: ATPVBAEN.xlma...

Code:
Set lot = CreateObject("Lotus.NotesSession")

lpwd = UserForm5.TextBox2.Value

Call lot.Initialize(lpwd)
Set ndir = lot.GetDbDirectory("")
Set ndb = ndir.OpenMailDatabase
Set ndoc = ndb.CreateDocument

nto = "sam123@in.ars.com"
'nto = UserForm4.TextBox10.Value

attach1 = pth1 & "score.xls"
   
With ndoc
  Set natt = .CreateRichTextItem("Body")
  Call .ReplaceItemValue("Form", "Memo")
  Call .ReplaceItemValue("Copyto", nto)
  Call .ReplaceItemValue("Subject", "Ticket Quality Audit ---" & UserForm4.ComboBox1.Value)
  Call .ReplaceItemValue("Body", _
  "Please find the attachment of quality audit done against the ticket that you have dealt")
  ndoc.SaveMessageOnSend = True
  Set attachme = ndoc.CreateRichTextItem("attach1")
  Set embed = attachme.EmbedObject(1454, "attach1", pth1 & "score.xls", "")
  Call .Send(False, nto)
 
  End With
 
  MsgBox "Mail has sent to-" & nto

in this at code first the error was thrown at
Code:
set lot = createobject("Lotus.Notessession")
and after that I got the same error at
Code:
Set ndir = lot.GetDbDirectory("")

Please suggest me and aswell if I want to use the code in Excel 2003 what else I have to do? what are the reference that I need to check.

Regards,
sakthi
 
Hi Narayan,

Thanks for your immediate response... when I work with some other system which has excel 2007 I got the error Can't find project or library and the listed references were highlighted as Missing.
1) ATPVBAEN.XLAM
2) ADO 6.0

what causing this error though both the machine is working with excel 2007...

Regards,
sakthi
 
Hi Narayan,

The problem is solved by using ADO 2.8 instead ADO 6.0... But, don't know why this has happened? What is the difference between ADO 2.8 and ADO 6.0.

Regards,
sakthi
 
Hi Narayan,

Thanks for the link and other info I wish to know from you...

Can we represent userform as HTML page... Like in Excel I create form and that form I need to use it in HTML so that I can paste the sheet some where in the common repository and people can use it which will open in the internet explorer.

Regards,
sakthi
 
Back
Top