I am using excel in office 365 on an Acer laptop running windows 10. I have been using the "File-Share-PDF" feature to send msgs to mutiple users some of whom do not have Office. Currently I am working a new project part of which I attach, "Bookings.xlsm". I want to make a data check before publication by email but wanted to check the "share as pdf" feature first. I recorded the sequence to a macro which produced the code:
ActiveWorkbook.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Owner\AppData\Local\Temp\Bookings.pd f", Quality:=xlQualityStandard _
, IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish _
:=True
Application.Dialogs(xlDialogSendMail).Show ', "C:\Users\Owner\AppData\Local\Temp\Bookings.pd f"
When run the file "Bookings.pdf" is created and Outlook is opened showing a new email but the excel file "Bookings.xlsm" is attached instead of the pdf. If I do it "manually" using the ribbon the pdf is attached.