Тёмный

Excel Macro to create PDF files using Word template 

Extreme Automation - Kamal Girdher
Подписаться 20 тыс.
Просмотров 13 тыс.
50% 1

See how we can create custom letters in pdf format using the data we have in excel and a word template. In this example, we have a Name field in pdf which is picked from excel and personalized letters are generated through the macro.
Subscribe to my channel to support!
You can ask questions in comments section..

Опубликовано:

 

8 май 2020

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 39   
@HamzaMalik-dj3wu
@HamzaMalik-dj3wu Год назад
Exactly what I was looking for. Can't tell you how happy I am to have found this video!
@j.dasilva4567
@j.dasilva4567 Год назад
Very very good, used it already. Thank u very much.
@sdasgupta18
@sdasgupta18 Год назад
Very helpful. Simple and solid solution. Thank you very much!
@xtremeExcel
@xtremeExcel Год назад
You are welcome😀
@FreeFrogWatching
@FreeFrogWatching Месяц назад
great video. This is close to what I am looking. I have a list in excel like this and Word mail merge. Do you know how to create a print button to print what row I select? or enter a row number to print?
@michaelgonzalez3251
@michaelgonzalez3251 2 года назад
This video is very helpful
@xtremeExcel
@xtremeExcel 2 года назад
Thanks.. stay connected
@intagoeng9532
@intagoeng9532 3 года назад
Thank you sir, this is very helpful! I have just one doubt- is it possibile to save pdf(s) by selecting a folder using the Application.FileDialog(msoFileDialogFolderPicker)? I'm trying with no success
@meherasees1790
@meherasees1790 3 года назад
Can you please help how to make the for loop dynamic
@rashmidhanda4370
@rashmidhanda4370 4 года назад
Hi thanks for the nice video..I need to attach pdf copies to the word doc template and then use the mail merge to send out mass emails I m able to create the emails using mailmerge and list but unable to add PDFs can you plz help..
@jainmohit09
@jainmohit09 3 года назад
Hi I have a image in word and want to add different name on that image. So I add text box. But when I run the macro all pdf show same name. Pls help
@Drivad2k10
@Drivad2k10 9 месяцев назад
Thanks for the video - I'm getting a Run-Time Error when I hit 'Set wd = New Word.Application' - any idea why this could be?
@sridharkrishnappanavanerth3388
@sridharkrishnappanavanerth3388 4 года назад
sir if the name column has first name and surname and i want pdf to be saved with only first name and unique id only, then what should i do.
@xtremeExcel
@xtremeExcel 4 года назад
You can extract first name using string manipulation functions (left, right, mid, len, instr etc).
@PrajyotNikhade
@PrajyotNikhade 10 месяцев назад
Hello sir...I am getting extra space in pdf when middle name is blank. Is there any solution sir plz help
@sofiarumi4288
@sofiarumi4288 Год назад
Love the video! thank you! I seem to get stuck at wd.Selection.Find - giving this error: Object variable or with block variable not set. Please help!!!
@sofiarumi4288
@sofiarumi4288 Год назад
Sub createPDFs() Dim wd As Word.Application Dim doc As Word.Document Set wd = New Word.Application wd.Visible = True For i = 2 To 7 Set doc = wd.Documents.Open("CC:\Users\sai\Documents\AP\xl to pdf\Template\Temp.docx") With wd.Selection.Find .Text = "" .Replacement.Text = Cells(i, 3).Value .Execute Replace:=wdReplaceAll End With doc.ExportAsFixedFormat OutputFileName:=ActiveWorkbook.Path & "/" & Cells(i, 1).Value & "_" & Cells(i, 2).Value & "_" & Cells(i, 4).Value & "_" & Cells(i, 3).Value & "_" & Cells(i, 5).Value & "_" & Cells(i, 6).Value & "_" & Cells(i, 7).Value & ".pdf", _ ExportFormat:=wdExportFormatPDF Application.DisplayAlerts = False doc.Close SaveChanges:=False wd.Quit Application.DisplayAlerts = True Next End Sub
@ignacioa3698
@ignacioa3698 4 года назад
You have webscraping for google chrome using Excel VBA? I tried using downloading Selenium but keep getting an error, I believe it may have been selenium download, google driver issues since I’ve read there’s issue with that? I’ve read Selenium has compatibility with Chrome old drivers? Even someone else in Github wrote a Selenium VBA code, and tried using that one, yet, didn’t work. dont know how to fix the issue. I’ve even completely uninstalled Chrome and installed Chrome again to begin from scratch, yet, kept getting error. If you can show the options using Selenium and how to download Selenium? And or if there are alternatives? Thx!
@xtremeExcel
@xtremeExcel 4 года назад
SeleniumWrapper is no longer supported and has been replaced by SeleniumBasic: florentbr.github.io/SeleniumBasic/ However, I recommend to use java or python as programming language if you want to use selenium.
@ignacioa3698
@ignacioa3698 4 года назад
@@xtremeExcel Thank youu. Yes, alternatively, I'm trying python w/Beautiful Soup to scrape data from an yahoo finan (a html page).
@tengtaichuang5456
@tengtaichuang5456 2 года назад
Hi Kamal, what if in my Word doc, there are more than one mail merge field, then how do I set the macro to include these fields to replace in every subsequent pdf?
@khat_diveprivate2518
@khat_diveprivate2518 7 месяцев назад
I have the same question. I have up to 20 merge fields.
@tengtaichuang5456
@tengtaichuang5456 2 года назад
May I know why there is a compile error "Next without For"?
@j.dasilva4567
@j.dasilva4567 Год назад
cause u are ending a /while/ cicle using a /next/ instead of /wend/, or else u are using a /next/ having a previous /next/, or else u are closing a /for/ cicle u didnt start.
@sarathysaru2104
@sarathysaru2104 3 года назад
hi can you please guide to save with header and footer of the word, in the current above code header is not getting saved
@xtremeExcel
@xtremeExcel 3 года назад
please send your file(having vba) to me.
@naive8547
@naive8547 Год назад
Thank you very much. I wrote the code but I think there's a lot of error. I wish I could've sent ss
@xtremeExcel
@xtremeExcel Год назад
Please send if you need help😀
@randy9833
@randy9833 Месяц назад
can u help me. (Office 2012) So i already follow ur step completely. no error but it wont create the PDF. can u help me? Thank you Sub createPDFs() Dim wd As Word.Application Dim doc As Word.Document Set wd = New Word.Application wd.Visible = True For i = 2 To 7 Set doc = wd.Documents.Open("D:\Folder Sampah\Surat CB\template.docx") With wd.Selection.Find .Text = "" .Replacement.Text = Cells(i, 1).Value .Execute Replace:=wdReplaceAll End With doc.ExportAsFixedFormat OutputFileName:=ActiveWorkbook.Path & "/" & Cells(i, 2).Value & "_" & Cells(i, 1).Value & ".pdf", _ ExportFormat:=wdExportFormatPDF Application.DisplayAlerts = False doc.Close SaveChanges:=False Application.DsplayAlerts = True Next wd.Quit End Sub
@sudhaposa4216
@sudhaposa4216 3 года назад
Sir, I need this coding file
@subharamachandran6753
@subharamachandran6753 Год назад
Hi.. I jus copied ur code.. pdf is getting created.. however none of the fields are merged.. what am I missing here.. can you help me.. thanks in advance.
@subharamachandran6753
@subharamachandran6753 Год назад
Find in vba is not recognizing the merge fields in the template and hence not replacing them. Please help to fix this
@icamaril7
@icamaril7 10 месяцев назад
Hi, word to PDF? Help me please
@LOL-ho4rt
@LOL-ho4rt 2 года назад
Hi I pretty much copied your code exactly and got a compile error. can you please help?
@LOL-ho4rt
@LOL-ho4rt 2 года назад
when I put Next wd.Quit End Sub it shows Compile error : Next without For and when I put Next wd.Quit End Sub It shows Compile error : Expected Function or variable Thanks,
@xtremeExcel
@xtremeExcel 2 года назад
Can u share the complete code pls?
Далее
Create PDF files for each Excel Rows by using Macros
9:26
Советы на всё лето 4 @postworkllc
00:23
🎸РОК-СТРИМ без ФАНЕРЫ🤘
3:12:10
Просмотров 1,4 млн
How to Create & Use Excel Macros (Real world example)
10:09
How to Create and Use Excel Macros 😎
13:43
Просмотров 47 тыс.
PDF to Word Converter Macro in Excel VBA
13:51
Просмотров 20 тыс.
Recording Powerful Macros in Microsoft Word
8:57
Просмотров 39 тыс.
Советы на всё лето 4 @postworkllc
00:23