Excel VBA SaveAs "Read-only" PDF File - Stack Overflow
Có thể bạn quan tâm
-
- Home
- Questions
- Tags
- Users
- Companies
- Labs
- Jobs
- Discussions
- Collectives
-
Communities for your favorite technologies. Explore all Collectives
- Teams
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Explore Teams Create a free Team - Teams
-
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about CollectivesTeams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about TeamsGet early access and see previews of new features.
Learn more about Labs Excel VBA SaveAs "Read-only" PDF file Ask Question Asked 2 years, 5 months ago Modified 2 years, 5 months ago Viewed 603 times 0The following code successfully saves an excel sheet as PDF. I would like to save it as a file, that can be opened by everyone, but not edited with the "fill and sign" feature, that is provided by Adobe Acrobat Reader DC. I have tried to simply add the following, but that does not work:
Attributes:=vbReadOnlyHere is the rest of the code:
Dim sPath As String sPath = "O:\" With Worksheets("Sheet 1") .ExportAsFixedFormat _ Type:=xlTypePDF, _ Filename:=sPath & UserForm.TextBox1.Value & ".pdf", _ Quality:=xlQualityStandard, _ IncludeDocProperties:=True, _ IgnorePrintAreas:=False, _ OpenAfterPublish:=False End With Share Improve this question Follow asked Jan 24, 2022 at 8:34 MarkAKEMarkAKE 452 silver badges8 bronze badges 0 Add a comment |1 Answer
Sorted by: Reset to default Highest score (default) Trending (recent votes count more) Date modified (newest first) Date created (oldest first) 1You should be able to use SetAttr after saving.
SetAttr "c:\path\yourfilename.pdf", vbReadOnly Share Improve this answer Follow answered Jan 24, 2022 at 12:00 ashleedawgashleedawg 21.2k9 gold badges78 silver badges113 bronze badges 1- not working, I´m still able to fill&sign the pdf – MarkAKE Commented Jan 24, 2022 at 16:20
Your Answer
Reminder: Answers generated by artificial intelligence tools are not allowed on Stack Overflow. Learn more
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Draft saved Draft discardedSign up or log in
Sign up using Google Sign up using Email and Password SubmitPost as a guest
Name EmailRequired, but never shown
Post Your Answer DiscardBy clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Not the answer you're looking for? Browse other questions tagged
or ask your own question.- Featured on Meta
- We spent a sprint addressing your requests — here’s how it went
- Upcoming initiatives on Stack Overflow and across the Stack Exchange network...
- What makes a homepage useful for logged-in users
- The [lib] tag is being burninated
Related
2 saving as PDF file on VBA return "Document not saved" error 1 store excel sheet as PDF on desktop 0 Using Excel VBA saveas function to save as PDF with user interaction 2 VBA “Save to PDF” saves even on cancels 2 Excel Save As PDF And Overwrite Existing 0 saving excel as pdf in active directory 0 Saving Excel Sheet as PDF 1 Save PDF from excel dynamically 0 Save as pdf using Mac Excel VBA 0 Writing and Saving to a PDF with VBAHot Network Questions
- A manifold whose tangent space of a sum of line bundles and higher rank vector bundles
- Air magic only used to decrease humidity and improve living conditions?
- If I Trace "Pickup", will I pickup?
- Do you always experience the gravitational influence of other mass as you see them in your frame?
- Weather on a Flat, Infinite Sea
- Can the differential be unitless while the variable have an unit in integration?
- Rolling median of all K-length ranges
- Two Sinus Multiply and Add
- Job talk Q&A: handling the room vs. being respectful
- It was the second, but we were told it was the fifth
- Would this telescope be capable to detect Middle Ages Civilization?
- Dual citizenship with USA & South Africa and exited South Africa on wrong passport (USA). What passport do I use to reenter SA?
- What is the correct translation of the ending of 2 Peter 3:17?
- Manga/manhua/manhwa where the female lead is a princess who is reincarnated by the guard who loved her
- Improve spacing around equality = and other math relation symbols
- Transferring at JFK: How is passport checked if flights arrive at/depart from adjacent gates?
- Can a country refuse to deliver a person accused of attempted murder?
- How to solve the intersection truncation problem of multiple \draw[thick, color=xxx] commands by color?
- Question about NMAP HTTP Verb Tampering
- Is the text of a LLM determined by a random seed?
- Star alliance lounge at Luxembourg?
- Would it be moral for Danish resitance in WW2 to kill collaborators?
- Who is the woman who speaks when the Ravagers stop the Benatar?
- ForeignFunctionLoad / RawMemoryAllocate and c-struct that includes an array
To subscribe to this RSS feed, copy and paste this URL into your RSS reader.
lang-vbTừ khóa » Visual Basic Excel Save As Pdf
-
Save Excel As PDF With VBA
-
Excel VBA Save As PDF: Step-By-Step Guide And 10 Code ...
-
Excel Macro To Save Sheets As PDF - Contextures
-
Excel VBA Save As (Print) To PDF
-
Excel Macro To Save As PDF (5 Suitable Examples) - ExcelDemy
-
Save File As PDF In VBA (macro)? | MrExcel Message Board
-
VBA Save Sheet As PDF - YouTube
-
Save Excel File As PDF Using VBA (Entire Workbook Or ... - YouTube
-
Save Excel As PDF With Excel VBA
-
Convert Excel To PDF Using VBA - The Only Guide You Will Need
-
How To Use Command Button To Save Active Worksheet As PDF File In ...
-
Export Docx To Pdf With Vba - Excel - Stack Overflow
-
Workbook.ExportAsFixedFormat Method (Excel) - Microsoft Docs
-
Excel VBA Save As PDF: Step-By-Step Guide And 10 ... - Pinterest