I want to create transfer some information from excel to a mail in outlook. I already have the following code:
</PRE>
I get an error using the code. Can someone help me fix this? I can copy using single cells using this method, however, it does not seem to work with bigger ranges. Also I want to keep the formatting intact. The code does not do that. I would appreciate if someone could help me fix this problem.
HTML:
Sub MailSend()
ActiveWorkbook.Save
Dim olApp As Object, olMail As Object
Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
olMail.to = "CAF Amsterdam CCRM; CAM Amsterdam"
olMail.Subject = "Holdings Swapclear " & Date - 1
olMail.sentonbehalfofname = "CAF Amsterdam CCRM"
olMail.body = "Dear CAM," & vbCr & vbCr & "Below you will find the Holdings concerning LCH Swapclear. " & vbCr & vbCr & Range("a18:b22") _
& vbCr & vbCr & "Kind regards," & vbCr & vbCr & "CAF Amsterdam"
olMail.Display
End Sub
</PRE>
I get an error using the code. Can someone help me fix this? I can copy using single cells using this method, however, it does not seem to work with bigger ranges. Also I want to keep the formatting intact. The code does not do that. I would appreciate if someone could help me fix this problem.