Sending Excel file as attachment to Lotus Notes mail

S

Simon Lenn

I want to program in VBA at the press of a button to send the Excel
range selected as a workbook attachment to Lotus Notes users.

Thanks
Simon
 
P

Paul Falla

Dear Simon

Please find below a code snippet which may help you.
Unfortunately, as far as I am aware, it is not possible to
select a range and send it as an attachment as if you were
printing it off. You will first need to copy and pase it
onto a new workbook and save it. The code below
incorporates this. I am also assuming that you are able to
send attachments using the "Send To---As Attachment"
function withing Excel, as this is what the code does.
Please post back if the code does not do quite what you
want it to.

Range("B2:E15").Select
Selection.Copy
Workbooks.Add
ActiveSheet.Paste
Application.CutCopyMode = False
ActiveWorkbook.SaveAs Filename:= _
"The_path_and_file_name_of_the_new_temporary_Excel_
File.xls", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False
Application.Dialogs(xlDialogSendMail).Show
End Sub

Hope this helps

Kind regards

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top