Hello Ashish,

Could u pls help on this error. Thanks!

On Tue, Aug 16, 2011 at 11:25 AM, Chandra Shekar <
chandrashekarb....@gmail.com> wrote:

> Hi Ashish,
>
> Thanks for the reply and patience. I have attached the excel file. I am
> facing below errors when I run the macro.
>
> 1. I am getting error as shown in mailerro1.bmp
> 2. I am not getting formated output in mail output as shown in
> mailerror2.bmp.
>
> Thanks,
>   On Tue, Aug 16, 2011 at 10:01 AM, ashish koul <koul.ash...@gmail.com>wrote:
>
>> hi chandar
>>
>>  i tried it its working fine  also ur code is password protected .can u
>> unlock it and send it again
>>
>>
>> On Tue, Aug 16, 2011 at 12:43 PM, Chandra Shekar <
>> chandrashekarb....@gmail.com> wrote:
>>
>>> Hi Ashish,
>>>
>>> Please find attached file and kindly do the needful. Thanks in advance.
>>>
>>>   On Tue, Aug 16, 2011 at 5:40 AM, ashish koul <koul.ash...@gmail.com>wrote:
>>>
>>>> can you attach your file
>>>>
>>>>
>>>>
>>>> On Mon, Aug 15, 2011 at 5:35 PM, Chandra Shekar <
>>>> chandrashekarb....@gmail.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I am getting attached error while running the macro. Please let me know
>>>>> whats the error in the below code.
>>>>>
>>>>>  *MailDoc.Save True, True, False*
>>>>>
>>>>> Regards,
>>>>>
>>>>> Chandra Shekar B
>>>>>   On Mon, Aug 15, 2011 at 11:43 AM, Chandra Shekar <
>>>>> chandrashekarb....@gmail.com> wrote:
>>>>>
>>>>>> Hi Asish,
>>>>>> Thank u for the help again I am getting error in the below code.
>>>>>> Please let me know whats the problem in the below code.
>>>>>>
>>>>>> Thanks in advance.
>>>>>> **
>>>>>> *MailDoc.Save True, True, False
>>>>>> *
>>>>>>   On Mon, Aug 15, 2011 at 9:53 AM, ashish koul <koul.ash...@gmail.com
>>>>>> > wrote:
>>>>>>
>>>>>>> dont use .copy  in set statement
>>>>>>>
>>>>>>>
>>>>>>> On Fri, Aug 12, 2011 at 3:43 PM, Chandra Shekar <
>>>>>>> chandrashekarb....@gmail.com> wrote:
>>>>>>>
>>>>>>>> Hello Ashish,
>>>>>>>>
>>>>>>>> I got solution for this issue but I am getting one more error in
>>>>>>>> code as type mismatch
>>>>>>>>
>>>>>>>>
>>>>>>>> *Set rnbody1 = Sheets("Details").UsedRange.Copy
>>>>>>>> rnbody1.Copy
>>>>>>>>
>>>>>>>> *
>>>>>>>>   On Fri, Aug 12, 2011 at 9:12 AM, Chandra Shekar <
>>>>>>>> chandrashekarb....@gmail.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Ashsh,
>>>>>>>>>
>>>>>>>>> I used ur code but getting error in below lines. I think I need to
>>>>>>>>> enable some reference. Please let me know about this.
>>>>>>>>>
>>>>>>>>> *Set Data = New DataObject
>>>>>>>>> Data.GetFromClipboard
>>>>>>>>> *
>>>>>>>>> Thanks,
>>>>>>>>>
>>>>>>>>> Chandra Shekar B
>>>>>>>>>   On Fri, Aug 12, 2011 at 8:21 AM, Chandra Shekar <
>>>>>>>>> chandrashekarb....@gmail.com> wrote:
>>>>>>>>>
>>>>>>>>>> Thanks Ashish I will check it out. :-)
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Fri, Aug 12, 2011 at 4:31 AM, ashish koul <
>>>>>>>>>> koul.ash...@gmail.com> wrote:
>>>>>>>>>>
>>>>>>>>>>> try these
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Wed, Aug 10, 2011 at 6:10 PM, Chandra Shekar <
>>>>>>>>>>> chandrashekarb....@gmail.com> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hi,
>>>>>>>>>>>>
>>>>>>>>>>>> In below code some times I could able to send attachments but
>>>>>>>>>>>> some times its not taking attachment at all. Please let me know 
>>>>>>>>>>>> whats is the
>>>>>>>>>>>> problem in the below code.
>>>>>>>>>>>>
>>>>>>>>>>>> Sub sendmail()
>>>>>>>>>>>> '
>>>>>>>>>>>> Dim UserName As String
>>>>>>>>>>>> Dim MailDbName As String
>>>>>>>>>>>> Dim Recipient As Variant
>>>>>>>>>>>> Dim ccRecipient As String
>>>>>>>>>>>> Dim Attachment1 As String
>>>>>>>>>>>> Dim Maildb As Object
>>>>>>>>>>>> Dim MailDoc As Object
>>>>>>>>>>>> Dim AttachME As Object
>>>>>>>>>>>> Dim AttachME2 As Object
>>>>>>>>>>>> Dim AttachME3 As Object
>>>>>>>>>>>> Dim AttachME4 As Object
>>>>>>>>>>>> Dim AttachME5 As Object
>>>>>>>>>>>> Dim Session As Object
>>>>>>>>>>>> Dim EmbedObj1 As Object
>>>>>>>>>>>> Dim EmbedObj2 As Object
>>>>>>>>>>>> Dim EmbedObj3 As Object
>>>>>>>>>>>> Dim EmbedObj4 As Object
>>>>>>>>>>>> Dim EmbedObj5 As Object
>>>>>>>>>>>> Dim stSignature As String
>>>>>>>>>>>> With Application
>>>>>>>>>>>> .ScreenUpdating = False
>>>>>>>>>>>> .DisplayAlerts = False
>>>>>>>>>>>> ' Open and locate current LOTUS NOTES User
>>>>>>>>>>>> Set Session = CreateObject("Notes.NotesSession")
>>>>>>>>>>>> UserName = Session.UserName
>>>>>>>>>>>> MailDbName = Left$(UserName, 1) & Right$(UserName,
>>>>>>>>>>>> (Len(UserName) - InStr(1, UserName, " "))) & ".nsf"
>>>>>>>>>>>> Set Maildb = Session.GetDatabase("", MailDbName)
>>>>>>>>>>>> If Maildb.IsOpen = True Then
>>>>>>>>>>>> Else
>>>>>>>>>>>> Maildb.OPENMAIL
>>>>>>>>>>>> End If
>>>>>>>>>>>> ' Create New Mail and Address Title Handlers
>>>>>>>>>>>> Set MailDoc = Maildb.CREATEDOCUMENT
>>>>>>>>>>>> MailDoc.Form = "Memo"
>>>>>>>>>>>> stSignature =
>>>>>>>>>>>> Maildb.GetProfileDocument("CalendarProfile").GetItemValue("Signature")(0)
>>>>>>>>>>>> ' Select range of e-mail addresses
>>>>>>>>>>>> Recipient = notes_id
>>>>>>>>>>>> MailDoc.SendTo = Recipient
>>>>>>>>>>>> MailDoc.Subject = "Test Mail "
>>>>>>>>>>>> MailDoc.Body = "Hi," & vbCrLf & vbCrLf & "Please find attached
>>>>>>>>>>>> schedule for the day " & vbCrLf & vbCrLf & "Regards" & vbCrLf & 
>>>>>>>>>>>> vbCrLf &
>>>>>>>>>>>> "Chandru"
>>>>>>>>>>>> ' Select Workbook to Attach to E-Mail
>>>>>>>>>>>> MailDoc.SaveMessageOnSend = True
>>>>>>>>>>>> Attachment1 = "C:\temp.bmp" ' Required File Name"
>>>>>>>>>>>> If Attachment1 <> "" Then
>>>>>>>>>>>> On Error Resume Next
>>>>>>>>>>>> Set AttachME = MailDoc.CREATERICHTEXTITEM("Attachment1")
>>>>>>>>>>>> Set EmbedObj1 = AttachME.EmbedObject(1454, "", Attachment1,
>>>>>>>>>>>> "Attachment1")
>>>>>>>>>>>> MailDoc.CREATERICHTEXTITEM ("Attachment1")
>>>>>>>>>>>> On Error Resume Next
>>>>>>>>>>>> End If
>>>>>>>>>>>> MailDoc.PostedDate = Now()
>>>>>>>>>>>> On Error GoTo errorhandler1
>>>>>>>>>>>> MailDoc.SEND 0, Recipient
>>>>>>>>>>>> Set Maildb = Nothing
>>>>>>>>>>>> Set MailDoc = Nothing
>>>>>>>>>>>> Set AttachME = Nothing
>>>>>>>>>>>> Set AttachME2 = Nothing
>>>>>>>>>>>> Set AttachME3 = Nothing
>>>>>>>>>>>> Set AttachME4 = Nothing
>>>>>>>>>>>> Set AttachME5 = Nothing
>>>>>>>>>>>> Set Session = Nothing
>>>>>>>>>>>> Set EmbedObj1 = Nothing
>>>>>>>>>>>> Set EmbedObj2 = Nothing
>>>>>>>>>>>> Set EmbedObj3 = Nothing
>>>>>>>>>>>> Set EmbedObj4 = Nothing
>>>>>>>>>>>> Set EmbedObj5 = Nothing
>>>>>>>>>>>> .ScreenUpdating = True
>>>>>>>>>>>> .DisplayAlerts = True
>>>>>>>>>>>> Exit Sub
>>>>>>>>>>>> End With
>>>>>>>>>>>> errorhandler1:
>>>>>>>>>>>> MsgBox Err.Description
>>>>>>>>>>>> Set Maildb = Nothing
>>>>>>>>>>>> Set MailDoc = Nothing
>>>>>>>>>>>> Set AttachME = Nothing
>>>>>>>>>>>> Set AttachME2 = Nothing
>>>>>>>>>>>> Set AttachME3 = Nothing
>>>>>>>>>>>> Set AttachME4 = Nothing
>>>>>>>>>>>> Set AttachME5 = Nothing
>>>>>>>>>>>> Set Session = Nothing
>>>>>>>>>>>> Set EmbedObj1 = Nothing
>>>>>>>>>>>> Set EmbedObj2 = Nothing
>>>>>>>>>>>> Set EmbedObj3 = Nothing
>>>>>>>>>>>> Set EmbedObj4 = Nothing
>>>>>>>>>>>> Set EmbedObj5 = Nothing
>>>>>>>>>>>> End Sub
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>>
>>>>>>>>>>>> ----------------------------------------------------------------------------------
>>>>>>>>>>>> Some important links for excel users:
>>>>>>>>>>>> 1. Follow us on TWITTER for tips tricks and links :
>>>>>>>>>>>> http://twitter.com/exceldailytip
>>>>>>>>>>>> 2. Join our LinkedIN group @
>>>>>>>>>>>> http://www.linkedin.com/groups?gid=1871310
>>>>>>>>>>>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>>>>>>>>>>>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>>>>>>>>>>>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>>>>>>>>>>>
>>>>>>>>>>>> To post to this group, send email to
>>>>>>>>>>>> excel-macros@googlegroups.com
>>>>>>>>>>>>
>>>>>>>>>>>> <><><><><><><><><><><><><><><><><><><><><><>
>>>>>>>>>>>> Like our page on facebook , Just follow below link
>>>>>>>>>>>> http://www.facebook.com/discussexcel
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>> *Regards*
>>>>>>>>>>> * *
>>>>>>>>>>> *Ashish Koul*
>>>>>>>>>>> *akoul*.*blogspot*.com <http://akoul.blogspot.com/>
>>>>>>>>>>> http://akoul.posterous.com/
>>>>>>>>>>> *akoul*.wordpress.com <http://akoul.wordpress.com/>
>>>>>>>>>>> My Linkedin 
>>>>>>>>>>> Profile<http://in.linkedin.com/pub/ashish-koul/10/400/830>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> P Before printing, think about the environment.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>>
>>>>>>>>>>> ----------------------------------------------------------------------------------
>>>>>>>>>>> Some important links for excel users:
>>>>>>>>>>> 1. Follow us on TWITTER for tips tricks and links :
>>>>>>>>>>> http://twitter.com/exceldailytip
>>>>>>>>>>> 2. Join our LinkedIN group @
>>>>>>>>>>> http://www.linkedin.com/groups?gid=1871310
>>>>>>>>>>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>>>>>>>>>>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>>>>>>>>>>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>>>>>>>>>>
>>>>>>>>>>> To post to this group, send email to
>>>>>>>>>>> excel-macros@googlegroups.com
>>>>>>>>>>>
>>>>>>>>>>> <><><><><><><><><><><><><><><><><><><><><><>
>>>>>>>>>>> Like our page on facebook , Just follow below link
>>>>>>>>>>> http://www.facebook.com/discussexcel
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>> --
>>>>>>>>
>>>>>>>> ----------------------------------------------------------------------------------
>>>>>>>> Some important links for excel users:
>>>>>>>> 1. Follow us on TWITTER for tips tricks and links :
>>>>>>>> http://twitter.com/exceldailytip
>>>>>>>> 2. Join our LinkedIN group @
>>>>>>>> http://www.linkedin.com/groups?gid=1871310
>>>>>>>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>>>>>>>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>>>>>>>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>>>>>>>
>>>>>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>>>>>
>>>>>>>> <><><><><><><><><><><><><><><><><><><><><><>
>>>>>>>> Like our page on facebook , Just follow below link
>>>>>>>> http://www.facebook.com/discussexcel
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> *Regards*
>>>>>>> * *
>>>>>>> *Ashish Koul*
>>>>>>> *akoul*.*blogspot*.com <http://akoul.blogspot.com/>
>>>>>>> http://akoul.posterous.com/
>>>>>>> *akoul*.wordpress.com <http://akoul.wordpress.com/>
>>>>>>> My Linkedin Profile<http://in.linkedin.com/pub/ashish-koul/10/400/830>
>>>>>>>
>>>>>>>
>>>>>>> P Before printing, think about the environment.
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>>
>>>>>>> ----------------------------------------------------------------------------------
>>>>>>> Some important links for excel users:
>>>>>>> 1. Follow us on TWITTER for tips tricks and links :
>>>>>>> http://twitter.com/exceldailytip
>>>>>>> 2. Join our LinkedIN group @
>>>>>>> http://www.linkedin.com/groups?gid=1871310
>>>>>>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>>>>>>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>>>>>>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>>>>>>
>>>>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>>>>
>>>>>>> <><><><><><><><><><><><><><><><><><><><><><>
>>>>>>> Like our page on facebook , Just follow below link
>>>>>>> http://www.facebook.com/discussexcel
>>>>>>>
>>>>>>
>>>>>>
>>>>> --
>>>>>
>>>>> ----------------------------------------------------------------------------------
>>>>> Some important links for excel users:
>>>>> 1. Follow us on TWITTER for tips tricks and links :
>>>>> http://twitter.com/exceldailytip
>>>>> 2. Join our LinkedIN group @
>>>>> http://www.linkedin.com/groups?gid=1871310
>>>>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>>>>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>>>>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>>>>
>>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>>
>>>>> <><><><><><><><><><><><><><><><><><><><><><>
>>>>> Like our page on facebook , Just follow below link
>>>>> http://www.facebook.com/discussexcel
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> *Regards*
>>>> * *
>>>> *Ashish Koul*
>>>> *akoul*.*blogspot*.com <http://akoul.blogspot.com/>
>>>> http://akoul.posterous.com/
>>>> *akoul*.wordpress.com <http://akoul.wordpress.com/>
>>>> My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830>
>>>>
>>>>
>>>> P Before printing, think about the environment.
>>>>
>>>>
>>>> --
>>>>
>>>> ----------------------------------------------------------------------------------
>>>> Some important links for excel users:
>>>> 1. Follow us on TWITTER for tips tricks and links :
>>>> http://twitter.com/exceldailytip
>>>> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
>>>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>>>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>>>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>>>
>>>> To post to this group, send email to excel-macros@googlegroups.com
>>>>
>>>> <><><><><><><><><><><><><><><><><><><><><><>
>>>> Like our page on facebook , Just follow below link
>>>> http://www.facebook.com/discussexcel
>>>>
>>>
>>> --
>>>
>>> ----------------------------------------------------------------------------------
>>> Some important links for excel users:
>>> 1. Follow us on TWITTER for tips tricks and links :
>>> http://twitter.com/exceldailytip
>>> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
>>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>>
>>> To post to this group, send email to excel-macros@googlegroups.com
>>>
>>> <><><><><><><><><><><><><><><><><><><><><><>
>>> Like our page on facebook , Just follow below link
>>> http://www.facebook.com/discussexcel
>>>
>>
>>
>>
>> --
>> *Regards*
>> * *
>> *Ashish Koul*
>> *akoul*.*blogspot*.com <http://akoul.blogspot.com/>
>> http://akoul.posterous.com/
>> *akoul*.wordpress.com <http://akoul.wordpress.com/>
>> My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830>
>>
>>
>> P Before printing, think about the environment.
>>
>>
>>   --
>>
>> ----------------------------------------------------------------------------------
>> Some important links for excel users:
>> 1. Follow us on TWITTER for tips tricks and links :
>> http://twitter.com/exceldailytip
>> 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
>> 3. Excel tutorials at http://www.excel-macros.blogspot.com
>> 4. Learn VBA Macros at http://www.quickvba.blogspot.com
>> 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
>>
>> To post to this group, send email to excel-macros@googlegroups.com
>>
>> <><><><><><><><><><><><><><><><><><><><><><>
>> Like our page on facebook , Just follow below link
>> http://www.facebook.com/discussexcel
>>
>
>

-- 
----------------------------------------------------------------------------------
Some important links for excel users:
1. Follow us on TWITTER for tips tricks and links : 
http://twitter.com/exceldailytip
2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310
3. Excel tutorials at http://www.excel-macros.blogspot.com
4. Learn VBA Macros at http://www.quickvba.blogspot.com
5. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 
To post to this group, send email to excel-macros@googlegroups.com

<><><><><><><><><><><><><><><><><><><><><><>
Like our page on facebook , Just follow below link
http://www.facebook.com/discussexcel

Reply via email to