Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.
Sub Email() Selection.AutoFilter Field:=1, Criteria1:="Open" Dim OutApp As Outlook.Application Dim OutMail As Outlook.MailItem Dim wb As Workbook Dim strdate As String strdate = Format(Now, "dd-mm-yy h-mm-ss") Application.ScreenUpdating = False Set xsheet = ActiveSheet ActiveSheet.Copy xsheet.UsedRange.Copy ActiveSheet.Range("A1") Set wb = ActiveWorkbook wb.Sheets(1).DrawingObjects.Visible = True wb.Sheets(1).DrawingObjects.Delete With wb .SaveAs "Part of " & ThisWorkbook.Name _ & " " & strdate & ".htm", FileFormat:=xlHtml Set OutApp = CreateObject("Outlook.Application") Set OutMail = OutApp.CreateItem(olMailItem) With OutMail .To = "email@example.com" .CC = "" .BCC = "" .Subject = "Latest Open Jobs Dated - " .Body = "Latest Open Jobs from My Workplace" .Attachments.Add wb.FullName .display End With .ChangeFileAccess xlReadOnly Kill .FullName .Close False End With Selection.AutoFilter Field:=1 End Sub
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
16 Experts available now in Live!