Hello Everybody,
I am currently trying to create an Excel macro that converts my excel sheet into a PDF file and then sends it out by email. My current macro can do this, but it cannot convert it to a PDF file. I tried to merge my current VBA formula with the one here:
to convert my excel sheet into a PDF file before sending it out. However, this did not work (I couldn't get this formula to work singlehandedly either).
Can somebody please help me in improving my formula so it converts my file into a PDF before it sends it out by email?
My current VBA looks like this:
Sub Email_From_Excel_Basic()
Dim emailApplication As Object
Dim emailItem As Object
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
' Now we build the email.
emailItem.To = "mymail@gmail.com"
emailItem.Subject = "Subject line for the email."
emailItem.Body = "The message for the email."
' Send the Email
' Use this OR .Display, but not both together.
emailItem.Send
' Display the Email so the user can change it as desired before sending it
' Use this OR .Send, but not both together.
'emailItem.Display
Set emailItme = Nothing
Set emailApplication = Nothing
End Sub
Or by photo:
If any of you should require further information, more photos or anything else, please let me know and I will respond immediately!
Thank you so very much!
Best regards,
David
I am currently trying to create an Excel macro that converts my excel sheet into a PDF file and then sends it out by email. My current macro can do this, but it cannot convert it to a PDF file. I tried to merge my current VBA formula with the one here:
Can somebody please help me in improving my formula so it converts my file into a PDF before it sends it out by email?
My current VBA looks like this:
Sub Email_From_Excel_Basic()
Dim emailApplication As Object
Dim emailItem As Object
Set emailApplication = CreateObject("Outlook.Application")
Set emailItem = emailApplication.CreateItem(0)
' Now we build the email.
emailItem.To = "mymail@gmail.com"
emailItem.Subject = "Subject line for the email."
emailItem.Body = "The message for the email."
' Send the Email
' Use this OR .Display, but not both together.
emailItem.Send
' Display the Email so the user can change it as desired before sending it
' Use this OR .Send, but not both together.
'emailItem.Display
Set emailItme = Nothing
Set emailApplication = Nothing
End Sub
Or by photo:
If any of you should require further information, more photos or anything else, please let me know and I will respond immediately!
Thank you so very much!
Best regards,
David