Hi Can anyone help, I am trying to Send a completed Excel sheet as email attachment using worksheet data using Windows 2010. Thank you in advance
Hi Can anyone help, I am trying to Send a completed Excel sheet as email attachment using worksheet data using Windows 2010. Thank you in advance
Last edited by ihenry; 05-31-2021 at 05:22 AM.
Option Explicit Sub Email_Worksheet_As_Workbook() ActiveSheet.Copy With ActiveWorkbook '.Windows(1).Visible = False Application.DisplayAlerts = False .SaveAs Environ("TMP") & "\tmp.xlsx", FileFormat:=xlWorkbookDefault, ConflictResolution:=xlLocalSessionChanges Application.DisplayAlerts = True .Close (True) End With With CreateObject("Outlook.Application").CreateItem(0) .To = "me@yahoo.com" .Subject = "Worksheet: " & ActiveSheet.Name .Body = "" .Attachments.Add Environ("TMP") & "\tmp.xlsx" .Display '.send End With End Sub
Hi Logit
Thank you so much, the code worked fine, the only thing now is how do I create a buttom that sits on the main page of the spreadsheet so that is can be run without opening up the VBAProject.
Once again thank you.
Hi Logit
Thank you so much, the code worked fine, the only thing now is how do I create a buttom that sits on the main page of the spreadsheet so that is can be run without opening up the VBAProject.
Once again thank you.
Hi Logit
Thats, me completed what I set out to do, thank you so much for your help with this one.
Everything is working perfectly.
Thank you
Best regards
Glad to assist.