Automate Excel To PDF & Send PDF Document As Mail Attachment

Automate Excel To PDF & Send PDF Document As Mail Attachment

Dinesh Kumar Takyar

9 лет назад

229,430 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@dydulsksuhd7209
@dydulsksuhd7209 - 07.03.2023 03:09

Thank you for this Dinesh. My question is how to express formula to send the payslip to the respective email add...considering i have an email address column in my active sheet.Thank you so much.

Ответить
@shahqasim8513
@shahqasim8513 - 09.02.2023 00:10

Thanks Sir !
Good lecture , well done.
Thanks alot 🌺

Ответить
@dhdj753
@dhdj753 - 30.11.2022 19:25

awesome video. how to add on in this vba with adding password on the exported pdf? also is there a way to automate different password to different client or recipient name?

Ответить
@terrig5704
@terrig5704 - 06.11.2022 15:33

Thank you. This solved a problem I have bee struggling with ever since I created my invoice

Ответить
@SGH-rt6ci
@SGH-rt6ci - 26.10.2022 19:37

Hello Mr Takyar, great video !!! In order to send an email I need to have my Outlook already open. Otherwise this HTML Emails sits somewhere and waits for OutLokk mail to be opened. How can I deal with that ?

Ответить
@ashwinisg7012
@ashwinisg7012 - 26.09.2022 23:10

i want to prepare a checklist for team and until the whole team signs the checklist the macro should throw an error while sending the email. Sir it would be really helpful if you can please guide me with this

Ответить
@ashwinisg7012
@ashwinisg7012 - 26.09.2022 23:04

I have created a macro in my personal workbook but when I saved it(macro enabled) in a shared path my teammates are unable to run the macro and there is no VBA found in their system. Please help me to fix this

Ответить
@ravi9827085006
@ravi9827085006 - 11.08.2022 15:42

need invoce no. in subject line

Ответить
@rajatdogra96
@rajatdogra96 - 26.07.2022 04:44

How to do iteration for multiple files in excel ( for loop ? )

Ответить
@JanKowalski-hk5cg
@JanKowalski-hk5cg - 20.04.2022 15:43

I have simply followed Your instructions and all works perfectly ! Thanks for sharing Your knowledge.

Ответить
@InsideMyWall
@InsideMyWall - 09.03.2022 11:31

If I want my pdf attachment with today's date , what should be done??

Ответить
@makaniharesh1459
@makaniharesh1459 - 02.01.2022 20:52

Air kya hum ise whatsapp par pdf share karna chahe to kaise kar sakte hai??

Ответить
@imtiahmed9443
@imtiahmed9443 - 23.12.2021 19:41

Hi. Thanks for the video. Is there a way to export whole workbook instead of one sheet. Thanks 😊

Ответить
@janardhanvn
@janardhanvn - 20.09.2021 20:06

Sub Sanction_Letter()
'
' Sanction_Letter Macro
'
ChDir "D:\Sanction Letters"
ActiveWorkbook.ExportAsFixedFormat xlTypePDF, "D:\Sanction Letters\" & Sheet2.Range("Companyname").Value & ".pdf", , , False, 2, 11, fasle

Dim OutLookApp As Object
Dim OutLookMailItem As Object
Dim myAttachments As Object


Set OutLookApp = CreateObject("Outlook.application")
Set OutLookMailItem = OutLookApp.CreateItem(0)
Set myAttachments = OutLookMailItem.Attachments

With OutLookMailItem
.To = Sheet1.Range("TO")
.CC = Sheet1.Range("CC")
.Subject = "sanction letter for sheet2.Range(companyname)"
.Body = “Pleas”
myAttachments.Add "D:\Sanction Letters\ & (sheet2.range(companyname).value & .pdf"
.send

End With

Set OutLookMailItem = Nothing
Set OutLookApp = Nothing

MsgBox ("Sanction letter has been generated successfully")

End Sub



getting an error cannot find this file, verify the path and file name are correct- please suggest how to write query for file path.

Ответить
@adminnehru8596
@adminnehru8596 - 14.09.2021 07:41

how can i directly directly generate salary slip from excel as PDF as send as gmail attachment without using Microsoft outlook?

Ответить
@ansarifaizan144
@ansarifaizan144 - 23.08.2021 19:16

Thanks a lot sir, this has helped a lot... God bless you!

Ответить
@alpserbetli6219
@alpserbetli6219 - 18.08.2021 15:21

How can I do it via IBM notes

Ответить
@puvmaker
@puvmaker - 22.07.2021 15:44

Hi Dinesh
Every coding is perfect but sending mail is not received in the recipient mail address. Please help me to get a solution. Thank you. Sujay

Ответить
@PAPEITO2566
@PAPEITO2566 - 24.06.2021 00:47

Very good video thank you!

One question, how can I automate this process without me having to be in excel? I would like this email/pdf attachment to automatically send to staff 30 days before a particular date in the Excel document?

This would serve as an automated email reminder from Excel that a task we are tracking in Excel has 30 days to be completed.

Thanks

Ответить
@sfaclkolvi191
@sfaclkolvi191 - 12.06.2021 15:41

Its so helpful for me but how to do when alots of person with different mail ID to send pdf file like this? Plz guide me.

Ответить
@Nuansacita
@Nuansacita - 08.06.2021 19:45

how to upload a pdf file and save in to a folder using VBA

Ответить
@ourmathsclass2999
@ourmathsclass2999 - 08.06.2021 19:32

Dear Dr Takyar,
Is there a way to print a PDF file with VBA? I am using windows 10 , 32 bit version, and excel 2010. I searched much, but unable to find a working method.
Thank you.
Piyal Fernando (Sri Lanka)

Ответить
@ourmathsclass2999
@ourmathsclass2999 - 04.06.2021 22:56

Thank you very much Dr. I met your videos only in last week and they help me to improve my knowledge in VBA =, Thank you so much again. Piyal Fernando (Sri Lanka)

Ответить
@deepakbarua8087
@deepakbarua8087 - 04.04.2021 10:30

I am using ms excel 2007 and word 2003 when I am copying your vba code its not working kindly fix it

Ответить
@ambilydileep
@ambilydileep - 19.03.2021 18:35

Sir, very useful but i am getting error in the line : ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:="C:\EXCEL_PDF\test_save.pdf”, OpenAfterPublish:=True"

Invalid procedure call or argument.. can u pls help me out

Ответить
@ankitjainkaka
@ankitjainkaka - 01.03.2021 17:36

Could you please help for generating multiple pdf through drop down cell value and email it with attachments and as email body as an image or snapshot of that pdf.

Ответить
@HeydudeitsMe
@HeydudeitsMe - 15.02.2021 17:57

What if if we have multiple sheets ?

Ответить
@lpcaspers
@lpcaspers - 30.12.2020 16:13

HI thank you for sharring!

I have develop you code a little bit and when i save i gets different PDF files names. Therefor i cant send the PDF i have just createt, only the one named in the code - How can i send the newest add PDF add file insted, so i send the right one out :)

Ответить
@andmelinda
@andmelinda - 26.11.2020 01:32

how do I change the mail to equal an email listed in the document?

Ответить
@ravikhande1546
@ravikhande1546 - 24.11.2020 19:14

Can we make PDF uneditable ...???

Ответить
@krishnaveni6384
@krishnaveni6384 - 24.10.2020 16:22

How to replace email client as lotus notes

Ответить
@rameshgowda8135
@rameshgowda8135 - 05.08.2020 18:43

Hi sir I need mail merge pdf with password protected is there any option do it.

Ответить
@aadyush
@aadyush - 01.08.2020 10:03

Hi sir
I am not able to open outlooks, it's going debugging always.
Although pdf created successfully
Thanks

Ответить
@aniljadhav9408
@aniljadhav9408 - 23.07.2020 22:19

Dinesh, I could run the VBA, issues I face, I shall like to pick up variables like File name, email address, subject from the excel sheet directly, or else what is a point if I need to keep on editing the VBA code for every memo I send? Will you bale to suggest how to bring the cell value to above?

Ответить
@nitinsuryawanshi8601
@nitinsuryawanshi8601 - 30.06.2020 17:13

How can we upload multiple excel file from local path to SharePoint url using VBA please suggest.

Ответить
@abdulmashood4646
@abdulmashood4646 - 27.06.2020 11:35

Dear Sir
Can I send it from my Firefox application.

Ответить
@alexandrusasu5597
@alexandrusasu5597 - 20.06.2020 10:05

Hello Dinesh,
I'm getting the 404 Error-Object not found by the line: myAttachments.Add "C:\Users\Sasu\Desktop\file-Test.pdf"
PDF Creation works fine, but the sending nis ot working. any idea what I might be doing wrong?
Thx btw, you're doing a great job!

Ответить
@richardmeborg4717
@richardmeborg4717 - 18.06.2020 12:23

Hi Denish. I am trying to transfer my Invoice to PDF but that will not work. This is the Code I use.

Private Sub cmdPDF_Click()
Dir "C:\Users\Desktop\Database"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\\Users\Desktop\Database\Incoice-save.pdf", OpenAfterPublish:=True

End Sub
And it will not either take ChDir
I don't know if it has something to do with I using Windows 8

Ответить
@safeerahmed4474
@safeerahmed4474 - 05.06.2020 22:21

Sir how to send any PDF attachments by email using VBA code

Ответить
@andersjensen745
@andersjensen745 - 02.06.2020 12:35

Hi Dinesh. This was just what i was looking for and i get it to woke just fine but I have one problem and i can't fine the solution anywhere so i relay hope you can help me. The Excel fill is online and is used by multiple users. how to write the code for multiple ?

I have tried with

Sub Send_MAIL_PDF()
ChDir "C:\"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
"C:\Users\Application.UserName\Desktop\Lopc.pdf"

Dim OutLookApp As Object
Dim OutLookMailItem As Object
Dim myAttachments As Object

Set OutLookApp = CreateObject("Outlook.application")
Set OutLookMailItem = OutLookApp.CreateItem(0)
Set myAttachments = OutLookMailItem.Attachments

With OutLookMailItem
.To = "........"
.Subject = "LOPC redo"
.Body = "REDO på LOPC"
myAttachments.Add "C:\Users\Application.UserName\Desktop\Lopc.pdf"
'.send
.Display
End With

Set OutLookMailItem = Nothing
Set OutLookApp = Nothing



End Sub

But it doesn't work
Please help

Best regards Anders

Ответить
@siddharthmkarthikeyan
@siddharthmkarthikeyan - 01.06.2020 11:02

Hi Takyar, it is a brilliant video. I have two questions. 1. In Subject it is possible to add present date and then followed by data. 2. Can i use the same procedure for word.

Ответить
@AIS-pt9np
@AIS-pt9np - 29.05.2020 06:14

I have a problem with the code ChDir that says Argument not optional . can anybody please help about that ?

Ответить
@wongpeggy4363
@wongpeggy4363 - 27.05.2020 16:03

but sirs if my excel consist there is a co logo will it capture?

Ответить
@wongpeggy4363
@wongpeggy4363 - 27.05.2020 15:59

yes perfect. let me try tommorrow. I have mutil task.

Ответить
@omer6759
@omer6759 - 14.05.2020 03:03

I have an error; Sub and Function Compille erorr. How can ı fix ?

Ответить
@SPTamilFamily.UKVLOGS
@SPTamilFamily.UKVLOGS - 11.05.2020 19:29

Hi sir,
Am generating XML file from excel instead of saving the generated XML. I have to send via outlook. How I should proceed with it. Please advise

Ответить
@Berita--Terkini
@Berita--Terkini - 01.05.2020 04:53

How to save Excel to pdf with save dialog.? Please

Ответить
@fakhrialanas6046
@fakhrialanas6046 - 23.04.2020 11:17

Easy to digest tutorial. thanks a lot!

Ответить
@techabreak7320
@techabreak7320 - 24.03.2020 08:21

This is awesome. Suppose I wanted to use my excel data as the name to save the PDF file how would I do that inVBA?

Ответить