hi
i have a button on my worksheet that when pressed automatically attaches my workbook to an outlook email. It there a way to make it only attach a sheet and not the whole workbook to the email and is it possible to have it not include certain columns in that sheet? For example I don't want info from columns H and I to be included in the sheet that is being emailed.
here is the script i am using to email my worksheet hope you understand what i am asking
thanks
i have a button on my worksheet that when pressed automatically attaches my workbook to an outlook email. It there a way to make it only attach a sheet and not the whole workbook to the email and is it possible to have it not include certain columns in that sheet? For example I don't want info from columns H and I to be included in the sheet that is being emailed.
here is the script i am using to email my worksheet hope you understand what i am asking
thanks
Sub Mail_workbook_Outlook_1()'Working in 2000-2007
'This example send the last saved version of the Activeworkbook
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
information on the email
.Attachments.Add ActiveWorkbook.FullName
'You can add other files also like this
'.Attachments.Add ("C:\test.txt")
.Display 'or use .Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub