I borrowed some VBA to send a worksheet as PDF. It works perfectly on my PC, but does nothing on a MAC. I get no error codes on the MAC. But the email does not send.
The code I am using is:
Thank you for any suggestionsSub SendWorkSheetBennett() 'Update 20131209 Dim Wb As Workbook Dim FileName As String Dim OutlookApp As Object Dim OutlookMail As Object On Error Resume Next Set Wb = Application.ActiveWorkbook FileName = Wb.FullName xIndex = VBA.InStrRev(FileName, ".") If xIndex > 1 Then FileName = VBA.Left(FileName, xIndex - 1) FileName = FileName & "_" + ActiveSheet.Name & ".pdf" ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FileName Set OutlookApp = CreateObject("Outlook.Application") Set OutlookMail = OutlookApp.CreateItem(0) With OutlookMail .To = "my mail here" .CC = "" .BCC = "" .Subject = "Rehearsal Notes" .Body = "Attached are notes from the recent rehearsal" .Attachments.Add FileName .Send End With Kill FileName Set OutlookMail = Nothing Set OutlookApp = Nothing End Sub
Bookmarks