No video

How to Password Protect PDF Files using VBA

  Рет қаралды 25,493

Jie Jenn

Jie Jenn

Күн бұрын

This is probably one of the most requested topics I got from my mail merge automation video. In this tutorial, we are going to look at how to use VBA in Excel to password protect a list of PDF files.
Download the command line encryption tool: learndataanaly...
Buy Me a Coffee? Your support is much appreciated!
-------------------------------------------------------------------------------------
🔑PayPal Me: www.paypal.me/...
🔑Venmo: @Jie-Jenn
💼Join Robinhood with my link and we'll both get a free stock 🤝 join.robinhood...
Support my channel so I can continue making free contents
---------------------------------------------------------------------------------------------------------------
Patreon: / jiejenn
By shopping on Amazon → amzn.to/2JkGeMD
More tutorial videos on my website → LearnDataAnaly...
Business Inquiring: KZbin@LearnDataAnalysis.org
#VBA #PDF #Encryption

Пікірлер: 100
@jiejenn
@jiejenn 2 жыл бұрын
There is a space after the exe path. ".exe " -> yes ".exe" -> no
@ShrajanShetty
@ShrajanShetty 2 жыл бұрын
Hi, could you provide the source code for this please?
@designexperience
@designexperience 25 күн бұрын
Couldn't download encryption tool 😢
@ramachandramurthykota4841
@ramachandramurthykota4841 Жыл бұрын
I am getting Runtime Error 1004 for this code Call Shell("encrypt_pdf.exe " & Chr(34) & .Cells(row_number, “B”).Value & Chr(34) & " " & Chr(34) & .Cells(row_number, "F").Value & Chr(34), vbNormalFocus) Can some one help me in cracking this error please
@shinli3632
@shinli3632 2 жыл бұрын
This is very helpful, thank you very much for sharing
@aidianyingren
@aidianyingren Жыл бұрын
Hi thank you for the program. However when I ran it, it does not automatically fill the PDFEncrypt menu. I need to type in. Do you know why? Thanks
@nurulsyuhada6493
@nurulsyuhada6493 Жыл бұрын
Hi! If I send the encrypted PDF files via email/telegram to many recipients, will the password work?
@ve6571
@ve6571 2 ай бұрын
where can we get encrypt_pdf.exe file
@amitmishra1513
@amitmishra1513 Жыл бұрын
Thanks excellent Video but it had encrypted only one file out of 3 when I run first time and 2nd time nothing happen
@abdelrhmanmohamed678
@abdelrhmanmohamed678 Жыл бұрын
Can you share the decompiled python code , I'm seeking to encrypt the pdf file with two passwords (owner and user) ?
@abhishodhds5322
@abhishodhds5322 2 жыл бұрын
Hi jie Can you make a video on creation of exe file
@fksoftware
@fksoftware 3 жыл бұрын
Excellent tool and thanks for sharing. Can we use the same tool to encrypt pdf to prevent editing or copying not password to open?
@jiejenn
@jiejenn 3 жыл бұрын
I don't think that's possible as far as I know.
@mariomakarawo
@mariomakarawo Жыл бұрын
Hi, can u help me, the application can’t working, i got notif encrypt_pdf.exe: error: following arguments are required: password Pls help to solve. Thank you 🙏🏻
@aarondumapias6084
@aarondumapias6084 11 ай бұрын
Hi did you already solve this problem?
@ekayuanita3026
@ekayuanita3026 Жыл бұрын
very useful. thank you
@onemusic3924
@onemusic3924 2 жыл бұрын
How to fix the Run-Time error 5 Invalid procedure called argument?
@MrMarek27
@MrMarek27 2 жыл бұрын
I want to use your method but i cant. Excel show Error "Object doesn't support this property or method". Do you know why? I have Office 2019 Home edition.
@cendydahinog1520
@cendydahinog1520 Жыл бұрын
i put your code and download encrypt_pdf but nothing happen😢.. can u help me ?
@cfisher3428
@cfisher3428 2 жыл бұрын
thanks, this is very useful
@kmdafzal
@kmdafzal Жыл бұрын
Very much useful
@neerajburra
@neerajburra Жыл бұрын
I am getting error 9, subscript out of range. Can anyone help me???
@DeadbeatGaming1705
@DeadbeatGaming1705 Жыл бұрын
Hey, can i merge this module into a separate module so that the mail merge, creation and encryption could be done together rather than seperate modules??
@jiejenn
@jiejenn Жыл бұрын
Sure, you can.
@samoaha
@samoaha 6 күн бұрын
first working and for second not working. hmmmmh
@kentlee3928
@kentlee3928 2 жыл бұрын
Hi. It shows "Run-time error "9": Subscript out of range When I run the macro. Please assist. Thank you!
@jiejenn
@jiejenn 2 жыл бұрын
Looks like the program cannot read your table properly.
@sergioaguirre3295
@sergioaguirre3295 2 жыл бұрын
You are amazing!!! This helps me a lot! Thanks!!!
@jiejenn
@jiejenn 2 жыл бұрын
I am guessing you got your issue resolved?
@sergioaguirre3295
@sergioaguirre3295 2 жыл бұрын
Yes! I was able to solve it, you have no idea how you help me with this tutorial
@VBAbyMBA
@VBAbyMBA 3 жыл бұрын
Is it possible for vba to encrypt while exporting pdf without using third-party software
@jiejenn
@jiejenn 3 жыл бұрын
I don't think that's possible at this point. If you do find a way, do let me know and I will buy you a coffee.
@terencexie2601
@terencexie2601 2 жыл бұрын
what if i have a few filepath to encrypt example: filepath 1 to filepath 6?
@jiejenn
@jiejenn 2 жыл бұрын
Update your file paths?
@nesyfitria4610
@nesyfitria4610 3 жыл бұрын
hi, can I use other software rather that encrypted_pdf.exe such a password tool?
@jiejenn
@jiejenn 3 жыл бұрын
Sure. If you do a Google search you should find a few 3rd party tools to encrypt PDD files.
@dominic2534
@dominic2534 Жыл бұрын
Hi, I am receiving the message "runtime error'53': file not found". I have seen other comments where you said to specify the file location in a variable to point to the binary. Can you explain how to do that? Where should it be included in the code?
@jiejenn
@jiejenn Жыл бұрын
Makes sure the spaces are in the correct places.
@dominic2534
@dominic2534 Жыл бұрын
@@jiejenn thank you for replying. The file name I entered like you did in your video. I do not know where to put the folder location.
@jessefreitag5374
@jessefreitag5374 Жыл бұрын
Hello, I copied the code exactly written, installed the encryption tool and when I run the macro, nothing happens. I open the pdf and there is no password. Do you have any advice?
@jiejenn
@jiejenn Жыл бұрын
Hard to tell without looking at your code.
@jessefreitag5374
@jessefreitag5374 Жыл бұрын
​@@jiejenn Code is below. Same as the video. I am saving my encrypt_pdf.exe , my excel file, and my pdf in the same path. The Call Shell("") command does not open the command line tool and when I run the command line tool, it opens quickly and immediately shuts. I even tried running as administrator. Sub PasswordProtect() Dim file_name As String Dim row_number As Long, last_row As Long Dim wsList As Worksheet Set wsList = ThisWorkbook.Worksheets("List") With wsList last_row = .Cells(Rows.Count, "A").End(xlUp).Row For row_number = 2 To lastrow Call Shell("encrypt_pdf.exe " & Chr(34) & .Cells(row_number, "A").Value & " " & Chr(34) & .Cells(row_number, "B").Value & Chr(34), vbNormalFocus) Next End With End Sub
@jessefreitag5374
@jessefreitag5374 Жыл бұрын
I am not getting an error, just nothing happens and I believe someone below has had the same issue in recent months. Can you please look into this and see if it works on your end still? Would be greatly appreciated!
@Smiledaiykub
@Smiledaiykub 2 жыл бұрын
Hi, Do you have encrypt_pdf for mac version?
@jiejenn
@jiejenn 2 жыл бұрын
Only Windows.
@sushenranjandas451
@sushenranjandas451 Жыл бұрын
Hello sir, Is there any way to decrypt pdf password using macro, like this?
@jiejenn
@jiejenn Жыл бұрын
Good suggestion. Let me put up a follow up video in the future.
@sushenranjandas451
@sushenranjandas451 Жыл бұрын
@@jiejenn Thank you.
@purplemoorselle
@purplemoorselle 2 жыл бұрын
Hi, this looks amazing! But is it possible to apply the macro to the pdfs instead of the .exe file?
@jiejenn
@jiejenn 2 жыл бұрын
Not sure if I follow your question.
@purplemoorselle
@purplemoorselle 2 жыл бұрын
@@jiejenn uhm but you have .exe file to which u applied the macro ight? Just wanted to know if this can be replicated to pdf files directly.
@jiejenn
@jiejenn 2 жыл бұрын
The macro calls the exe file. VBA doesn't have a defaulf library to work with PDFs.
@purplemoorselle
@purplemoorselle 2 жыл бұрын
@@jiejenn I see. So it means I need to create a .exe file first?
@sifatullah8071
@sifatullah8071 2 жыл бұрын
Can anyone share this code to me ?
@DrJohnners
@DrJohnners Жыл бұрын
Excellent tool! Many thanks. One thing i was wondering is why is the .exe so big, I'm guessing it's because there are a number of heavy runtimes that you need?
@jiejenn
@jiejenn Жыл бұрын
This tool was packaged using the old Python library called pyinstaller, which the packaging mechanism wasn't very efficient. They have since improved the packaging mechanism, and the executable file size is much smaller. I probably need to repackage this app when I get a chance.
@raymarc3353
@raymarc3353 3 жыл бұрын
Hi, I'm getting a debug error in line 5, set...kindly help I'm using office 19
@jiejenn
@jiejenn 3 жыл бұрын
Are you using Windows or MacOS?
@khanhhuynh5557
@khanhhuynh5557 2 жыл бұрын
Hi, Just add the folder path where you put file "encrypt_pdf.exe" in the call command. It will solve the problem. E.g. Call Shell(ActiveWorkbook.Path & "\" & "encrypt_pdf.exe " & Chr(34)...
@ThanhNguyen-dw4il
@ThanhNguyen-dw4il 2 жыл бұрын
​@@khanhhuynh5557 It is run but pdf output file is no password. Maybe file ecrypt_pdf is not working.
@chiragpatel1706
@chiragpatel1706 3 жыл бұрын
File not found error ??
@jiejenn
@jiejenn 3 жыл бұрын
Just tested, it is there.
@chiragpatel1706
@chiragpatel1706 3 жыл бұрын
@@jiejenn Yes all file are in same folder 🤔( runtime error'53': file not found)
@sergiocastro1561
@sergiocastro1561 2 жыл бұрын
same error here, file not found error 53
@akashrawat5329
@akashrawat5329 2 жыл бұрын
@@jiejenn Please can you help resolve this error.
@khanhhuynh5557
@khanhhuynh5557 2 жыл бұрын
Hi, Just add the folder path where you put file "encrypt_pdf.exe" in the call command. It will solve the problem. E.g. Call Shell(ActiveWorkbook.Path & "\" & "encrypt_pdf.exe " & Chr(34)...
@onemusic3924
@onemusic3924 2 жыл бұрын
Can you send VBA code sir ?
@jiejenn
@jiejenn 2 жыл бұрын
Maybe type it out yourself?
@floalas
@floalas 2 жыл бұрын
Hello JieJenn, I don’t have Python Exe file & I know it will not work. How shall I get it from you?
@jiejenn
@jiejenn 2 жыл бұрын
Not sure if I understand your question.
@floalas
@floalas 2 жыл бұрын
In your video you mentioned create using python. There was an . Exe file on your video. How can I get this file ? The script won’t work without this file.
@jiejenn
@jiejenn 2 жыл бұрын
@@floalas I used Python to create the command line tool. You don't need Python to use the tool.
@floalas
@floalas 2 жыл бұрын
I don’t have the encrypt_pdf.exe. I tried to run the script got error.
@jiejenn
@jiejenn 2 жыл бұрын
Ok.
@LoneIcon
@LoneIcon 2 жыл бұрын
hi, i tried it today and i got this error "runtime error'53': file not found" The error is pointing to Call Shell("encrypt_pdf.exe" ...
@jiejenn
@jiejenn 2 жыл бұрын
The error is due to VBA cannot locate the binary.
@Indie-Digger
@Indie-Digger 2 жыл бұрын
@@jiejenn Is there a way to let VBA to locate the binary?
@jiejenn
@jiejenn 2 жыл бұрын
You specify the file location in a variable to point to the binary.
@Indie-Digger
@Indie-Digger 2 жыл бұрын
@@jiejenn Thx for replying so fast,, it's really my first time to use VBA.. would you please tell me how to set the location in the variable?
@sergioaguirre3295
@sergioaguirre3295 2 жыл бұрын
I’m facing the same issue
@erikachen5747
@erikachen5747 3 жыл бұрын
How can I create the file of pdf.exe??Thank you.
@jiejenn
@jiejenn 3 жыл бұрын
I'm not following your question.
@erikachen5747
@erikachen5747 3 жыл бұрын
There is a file named of “encrypt_pdf.exe. You mentioned that is created using Python and will share the source code in another tutorial.
@jiejenn
@jiejenn 3 жыл бұрын
Oh yeah. I haven't create the tutorial for that. Been busy.
@susmithasunil6611
@susmithasunil6611 2 жыл бұрын
@@jiejenn please share the tutorial for the same
@yashkumargupta7102
@yashkumargupta7102 2 жыл бұрын
@@jiejenn Hi Jie, Can you please share the Tutorial for encrypt_pdf.exe
@priyanthagamini3860
@priyanthagamini3860 2 жыл бұрын
Exactly Good ❤️❤️❤️ would you please give me the link for "encript_pdf.exe"
@sifatullah8071
@sifatullah8071 2 жыл бұрын
Can you send VBA code sir ?
@jiejenn
@jiejenn 2 жыл бұрын
Maybe type it out yourself?
Create multiple PDFs based on a list in Excel | Excel Off The Grid
13:02
Excel Off The Grid
Рет қаралды 33 М.
ISSEI & yellow girl 💛
00:33
ISSEI / いっせい
Рет қаралды 24 МЛН
Can This Bubble Save My Life? 😱
00:55
Topper Guild
Рет қаралды 83 МЛН
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 52 МЛН
How I Did The SELF BENDING Spoon 😱🥄 #shorts
00:19
Wian
Рет қаралды 36 МЛН
Mail Merge password protected PDF and Word documents
5:29
MAPILab
Рет қаралды 21 М.
PowerAutomate - Protect PDF with Password
7:24
M365 Tech Help
Рет қаралды 7 М.
Vòng lặp trong VBA Excel
36:01
Gà Excel
Рет қаралды 34 М.
Excel Macro to create PDF files using Word template
7:29
Extreme Automation - Kamal Girdher
Рет қаралды 13 М.
Use Power Automate to Secure Documents
14:51
Clavin Fernandes
Рет қаралды 4,2 М.
How To Read PDF Files Using Excel Macros
14:36
Automation Made Easy
Рет қаралды 18 М.
Automation: Bulk Files (Excel, Word and PDF) Creator in Excel VBA
14:46
PK: An Excel Expert
Рет қаралды 20 М.
PDF to Excel Converter in Excel VBA
8:18
PK: An Excel Expert
Рет қаралды 112 М.
PDF to Word Converter Macro in Excel VBA
13:51
PK: An Excel Expert
Рет қаралды 20 М.
ISSEI & yellow girl 💛
00:33
ISSEI / いっせい
Рет қаралды 24 МЛН