VBA to save an Excelfile as pdfdocument with a pdf document open password

I use VBA and Adobe Acrobat PDFMaker to save Excel-files as pdfs.
The code I use works perfectly (see below). Which VBA-command is
necessary to add a Document Open Password to the pdf to open the pdf-file?
thank you in advance and
best regards
gauss
Sub xls_to_pdf()
Dim member As Variant
pdfZähler = 0
  dieseDatei = ThisWorkbook.Path & "\" & Left(ThisWorkbook.Name, Len(ThisWorkbook.Name) - 4)
  drucker = "Adobe PDF"
  Sheets("Frontpage").Select: drucken_mergen
  Sheets("Final").Select
  For Each member In Range("regionen")
    Range("A1").Value = member
    Application.Calculate
    drucken_mergen
  Next member
End Sub
Sub drucken_mergen()
'drucken
Dim AdobeDistiller As ACRODISTXLib.PdfDistiller
Set AdobeDistiller = New ACRODISTXLib.PdfDistiller
  If pdfZähler = 0 Then
    file(0) = dieseDatei
    Else
    file(pdfZähler) = dieseDatei & Format(pdfZähler, "0000")
  End If
  ActiveSheet.PrintOut copies:=1, preview:=False, _
    ActivePrinter:=drucker, printtofile:=True, printtofile:=True, _
    prtofilename:=file(pdfZähler) & ".ps"
  AdobeDistiller.FileToPDF file(pdfZähler) & ".ps", file(pdfZähler) & ".pdf", ""
  Kill file(pdfZähler) & ".log"
  Kill file(pdfZähler) & ".ps"
'mergen
Dim pdfZiel As AcroPDDoc
Dim pdfQuelle As AcroPDDoc
Set pdfZiel = CreateObject("AcroExch.PDDoc")
Set pdfQuelle = CreateObject("AcroExch.PDDoc")
If pdfZähler = 0 Then
  pdfZiel.Open (file(pdfZähler) & ".pdf")
  Else
  pdfZiel.Open (file(0) & ".pdf")
  pdfQuelle.Open (file(pdfZähler) & ".pdf")
  pdfZiel.InsertPages pdfZiel.GetNumPages - 1, _
    pdfQuelle, 0, pdfQuelle.GetNumPages, True
  pdfQuelle.Close
  pdfZiel.Save 1, file(0) & ".pdf"
  Kill file(pdfZähler) & ".pdf"
End If
pdfZähler = pdfZähler + 1
End Sub

Dear Irosenth
thank you for your answer!

Similar Messages

  • I have an issue with some PDF documents   some MS Office documents, notably MS Word when received in eMail as attachments not displaying on iPhones, iPad 2s

    Hi,
    I have an issue with some PDF documents & some MS Office documents, notably MS Word when received in eMail as attachments not displaying properly on iPhones, iPad 2s & new iPads?
    PDF docs - areas of the doc only show as grey splotches regardles of viewer
    MS Word Docs -
    inserted graphics don't display at all,
    tables & lists especially with borders are broken &
    tables & lists missing the borders &
    tables & lists missing the 1st 1-2 lines of the lists/tables.
    This is replicated on iPhone 4s, iPhone 4Ss, iPad 2s, iPad new (x2)
    It certainly happens in iOS 5.1.1 & iOS 5.1
    We believe it all worked aok in iOS 5.0.1(?) & prior
    There is no problems reading/seeing these PDF & Word docs on anything other than iDevices.
    This is rather critical for us & if not quickly fixed/rectified will prevent us from further purchases of these devices
    Rolling back to iOS 5.0.1 or prior I believe isn't possible because of the BaseBand update(?) & isn't much of an option because of the quite noticeable Battery/Charging/WiFi improvements in 5.1 & 5.1.1

    Hi,
    I logged a call with AppleCare & have since had explained why this occurs (some time ago)
    I'll try to explain what was indicated to me.
    iOS has a limited Font Set & this affects what PDFs can display. You need to use iOS supported fonts in your PDFs to see/read them properly  
    These supported fonts are indicated here => http://support.apple.com/kb/HT4980
    Regards MS office docs, iOS doesn't have much of an API to work with MS Office documents at all so is stuck with 3rd Party Apps to try to do it.
    Unfortunately Mail in/on iOS uses the API to attempt to open/use MS Office attachments unless you tell it to use an App to open the attachment.
    I have had success opening & reading MS office docs now with CloudOn, but find it slow & very awkward to use.
    Not too sure if this helps others, but at least it explains why this is occurring

  • PDF document opened with Preview does not show french accents

    Hi everybody,
    I've got some issues with PDF documents opened with Preview.
    They show a blank space for all the accented vowels.
    If I open the same document with Safari, it's the same. But with Chrome, it works perfectly.
    I assume there's a problem with fonts, but, nothing wrong with fontbook (checked duplicates for instance).
    Last information : it looks ok within chrome on my Imac, but the issue comes back when I try to print from chrome app...the accents are gone on the sheet.
    Any idea ? I don't want to install Adobe reader...
    Thanks for your help !
    http://www.art-shots.net/

    I don't want to install Adobe reader...
    Why not?  It can handle some pdf's that Preview can't.  At least it's worth a try.
    In case you change you mind get it from here.

  • I hate this, now all pdf documents open with Adobe reader x

    Until recently all pdf documents opened nicely with Adobe Acrobat which was installed with the creative suite CS5. Recently I had to update the Acrobat plugin for Firefox and I don't know what exactly was installed but somehow I ended up with Adobe Reader x on my computer and now when I open pdf documents from my hard drive they all open with an Adobe reader which I hate. How that reader managed to install and change my experience without me noticing? Now I have to change file associations. Do I need this reader and what is it for when I have a full version of Acrobat?
    I will greatly appreciate your help.

    Unfortunately, once Reader is installed, uninstalling it will require you to repair your Acrobat installation. You should be able to right click on a PDF and select Open With and set Acrobat as the default. Also, be sure that Reader is not part of the startup of Windows (you can use Start>Run>msconfig to check that) and also open current tasks (ctrl-alt-del) and be sure AcroRd32 or similar file is not running in the background. Be aware that AcroTray is part of Acrobat and is needed for PDF creation.

  • PDF documents opens with black background.

    Problem with black background in PDF documents opened from Safari. The documents are not readable.

    Thank you, problem solved.
    Søren Boensvang
    e-mail: [removed]
    Den 01/07/2013 kl. 16.40 skrev C F McBlob <[email protected]>:
    Re: PDF documents opens with black background.
    created by C F McBlob in Adobe Reader - View the full discussion
    Quit Safari.
    Go to   /Library/Internet Plug-Ins
    Move the Adobe PDF Browser plugin  (or just PDF Browser plugin) to the Trash.
    Relaunch Safari. Try a PDF file.
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5466423#5466423
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: Re: PDF documents opens with black background.
    To unsubscribe from this thread, please visit the message page at Re: PDF documents opens with black background.. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Adobe Reader by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • Sudden printing problems with scanned pdf documents

    Hi, I suddenly experience problems when I want to print scanned pdf documents.
    Since 2 years, I am using an iMac with a Fujitsu ScanSnap S1500M and a Samsung ML-2525W. I also use Acrobat Pro 9.0 provided with the scanner. I scan documents, save them as pdfs and print them. Worked fine until just recently. If I print scanned pdf documents, the printer give white pages. Other pdf documents get printed without problems.
    I use OS X Yosemite (10.10.1) and ScanSnap Manager 3.2.L63.
    Any advice is highly appreciated

    Hi Roger - the problem was going from 10.6.7 to 10.6.8. That is when all of the printing problems began, as well as the wifi getting flaky. I was able to get the iMac speaking politely to the printer by installing Repair 10.6.8 and re-adding the Canon printer (see below):
    Printer “failure”
    Probably the single most common 10.6.8 problem, at least as evidenced by a massive 17 page thread in Apple Support Communities, is a failure to print. The typical symptom is that the printer driver software pauses, displaying a message that states something like: “printer-state-message="/usr/libexec/cups/backend/lpd failed" or “/usr/libexec/cups/backend/dnssd failed.” Not all printers have this problem, but users report seeing the symptom in a variety of different printers.
    As is often the case with update-related problems, reinstalling 10.6.8 from the combo updater may eradicate the symptom. Another possible solution is modifying a printer file in the /etc/cups/ppd directory (as detailed in the above-linked thread).
    Unfortunately, none of these solutions are guaranteed to work. What does reliably fix the problem is to downgrade back to 10.6.7. If you’d rather stick with 10.6.8, you can instead downgrade just the quartet of printer-related files that appear to be the root cause of the symptom. These are the socket, dnssd, lpd and ipp files, located in the /usr/libexec/cups/backend directory.
    A Mac user wrote an application, Repair10.6.8 (direct download link), that automatically downgrades these four files for you. Several users report success with this program. After running the Repair app, you may also need to “reset printing system” by selecting the command from the contextual menu for the printer name in the Print & Fax System Preferences pane.
    from MacUser 10.6.8. workaround articlehttp://www.macworld.com/article/160993/2011/07/1068_bugs.html#lsrc.nl_mwweek_t_c bstories

  • With a document open password - is there a way to ask only once per session?

    Here's my scenario:  User is reading a "password to open" document that contains links to other web pages, etc.  The user clicks on a link, goes to the new page, then uses the back button/back key to return to the password protected document, where they must type in the password to open again, and must do this every time they click a link then later attempt to return to the document. 
    Is there a way around the repeated retyping / reentering / rekeying the password?  (My guess is no, but I'll ask anyway).  The user did type in their password, most of the time just a minute or two earlier, before they clicked on the link in the password protected document. 
    P.S. I have a couple other questions, indirectly related (byproducts) to this general topic.  I'll post those in their appropriate forum, then edit this post with links to those posts.  FYI, the other posts are/will be:
    Is there a better way than manually adjusting each and every link in a document to use javascript and repeating that process each time the document is updated, to make links open in new windows, (when viewing a pdf from within a browser window).  [Edit:  here's that link:  http://forums.adobe.com/message/5055202#5055202 ]
    Is there a way from an html page or from something within a PDF document (at the discretion of the document's author) to open a pdf in the acrobat reader window instead of in the browser, without asking each user to change their reader settings?  [Edit:  I ended up asking this question in the same post listed above]

    Once the instance of Acrobat or Reader containing a password-protected PDF file has been closed, you can't avoid having to re-enter the password. If the links don't target a new tab or window, then the browser will unload the plugin - and aside from changing all the link targets, you can't prevent that.

  • How to get Font's associated with a pdf document.

    Hi All,
    I am currently working on a project related to Document Management in SAP. For this I have a set of pdf document's that needs to be classified as 'searchable' and 'Non-searchable'. I am planning to identify the document based on Font contents i.e a searchable document has some font associated with it, and non-searchable documents do not have any font associated with it.
    I am trying to use the class cl_fp_pdf_object and get the information about font. I see that there is no function which gives me this information directly. Is there any way to get font information of a pdf documents using classes ? or Is there any way to identify directly weather a document is searchable or not ?  Please help.
    DATA: l_fp          TYPE REF TO if_fp,
               l_pdfobj      TYPE REF TO if_fp_pdf_object.
        Create PDF Object.
          l_pdfobj = l_fp->create_pdf_object( connection = p_dest ).
        Set document.
          l_pdfobj->set_document( pdfdata = l_pdf ).
        Set task to get metadata.
          l_pdfobj->set_task_getmetadata( ).
        Execute, call ADS.
          l_pdfobj->execute( ).
    Thanks
    Aditya

    Just curious....why would you make "font" the basis of that classification?

  • Whenever I have a pdf document open, and then switch to another tab to view another webpage, the scrolling function on the touchpad will not work. This seems to be a glitch with Mozilla, according to Dell. How do I fix this?

    When I open a pdf document (like an E-version of a newspaper) in Mozilla and then switch to another tab to view another webpage, I am unable to use the scrolling function on the touchpad. I have to use the up and down arrows to get other pages to scroll. When I close that pdf document, everything works fine. I talked with customer support with Dell, and he said it was probably a glitch with Mozilla. So I tried to do the same thing on IE, and there was no problem scrolling with the touchpad while a pdf document was open on another tab. I would like to get a fix for this so I don't have to keep closing open pdf documents in order to scroll with the touchpad while on other tabs. Thank you

    Hi elliezzz,
    If you are having issues with your iPhone not being recognized by iTunes, you may find the following article helpful:
    iOS: Device not recognized in iTunes for Mac OS X
    http://support.apple.com/kb/ts1591
    Regards,
    - Brenden

  • How to save the output of sap script to pdf document in sap

    hi abapers
    how to save the output of sap script in sap so that can retrieve the saved document later.
    i have to save the rcia output from sap script in pdf document in sap so that it can be retrieved later
    how to use dms

    Hi deepika,
    This thread will solve ur problem OTF  -> PDF
    Regards,
    Pravin

  • Problem with linking PDF documents using named destinations

    Linking from one PDF document to another PDF document using named destinations viewed in Reader works great but once the documents are viewed inside a browser environment the link will only open the go to document and will not go to the named destination.
    If I make the links using the page number - yes they will work perfectly in the browser. But my problem is that the documents may change in the future and the links may be on differnt pages, so I need to use named destinations to bring me to the page of the PDF they are on.
    Any suggestions? I need them to work in IE.
    Thanks

    You can link to a named destination with a URL. This might work better in
    your case... To do it use the following format:
    http://example.org/doc.pdf#nameddest=Chapter6

  • How to make a PDF document open with bookmarks showing

    I have created a big PDF document that I will be making available to multiple users via Dropbox.  How do I (can I) make the document open with the bookmarks showing?
    Using Acrobat 10.1.10
    Thanks, Dan

    Go to File - Properties - Initial View and under Navigation Tab select "Bookmarks Panel and Page".

  • Please Help with Converting PDF document to Word Document

    I have downloaded our PDF document to be converted to a word document --- it did not work correctly--we need help with this
    Scott Munsen
    Abbott House -- Mitchell, SD

    Good day Scott,
    I received your document via our File Conversion Issue form.  The root of the problem you're facing is the quality of the scan.  I'm not sure if you were starting with a poor quality hard-copy or simply low DPI settings on your scanner, but the reason the results you received were so different than the PDF was the quality of the input.
    If you're hard copy looks clearer than the PDF file you created, I would suggest increasing the resolution settings on your scanner.
    Please let me know if you have any questions.
    Kind regards,
    David

  • HT2506 "Find next"  with a PDF document

    I would like to use the "Find next string" of a PDF document with Preview.
    When i fill the search window, Preview does the search on the entire document, and shows the first occurence it has found. Thus, making me loose my current reading page. 
    I just want to do a forward search !
    Thank you

    Use Adobe Reader - http://get.adobe.com/reader/.
    Preview is just horrible, to my way of thinking and working, with PDF files.
    Clinton

  • Error with a PDF document in a BSP App: "File does not begin with '%PDF-'"

    Hi All,
    I have the following piece of in the layout of a BSP Application in our system.
    <%
    DATA: LV_PDFSIZE TYPE I,
                LW_PDF     TYPE TLINE,
                LV_XDATA   TYPE XSTRING.
    data: LT_PDF type ZGTIS_TAB_TLINE,
          lv_id type zgtis_http_id,
          filename type STRING.
    lv_id = session_id.
    import lt_pdf to lt_pdf from
           database zgtis_http_indx(in) id lv_id.
    RUNTIME->SERVER->RESPONSE->SET_HEADER_FIELD(
        NAME  = 'Content-Type'
        VALUE = 'application/pdf').
    if w_printall ne 'X'.
    CONCATENATE 'display; filename="invoice_' BIL_NUMBER '.pdf"'  INTO filename.
    else.
    CONCATENATE 'display; filename="invoice_' 'ALL' '.pdf"'  INTO filename.
    endif.
    RUNTIME->SERVER->RESPONSE->SET_HEADER_FIELD(
        NAME  = 'Content-Disposition'
        VALUE = filename ).
    RUNTIME->SERVER->RESPONSE->SET_HEADER_FIELD(
        NAME  = 'pragma'
        VALUE = 'no-store').
    RUNTIME->SERVER->RESPONSE->SET_HEADER_FIELD(
        NAME  = 'cache-control'
        VALUE = 'no-store').
    *     Convert to XSTRING
    FIELD-SYMBOLS <P> TYPE ANY.
    LOOP AT LT_PDF INTO LW_PDF.
      ASSIGN LW_PDF TO <P> CASTING TYPE X.
      CONCATENATE LV_XDATA <P> INTO LV_XDATA
        IN BYTE MODE.
    ENDLOOP.
    *     Set the response data
    RUNTIME->SERVER->RESPONSE->SET_DATA(
        DATA   = LV_XDATA ).
    %>
    This piece of code works fine when 'If w_printall ne 'X'.' condition is succesfull and I can see the PDF but when w_printall = 'X' I get the above error on a popup box, the error is "File does not begin with '%PDF-'" and I cant see the PDF.
    Does anyone have any suggestions!
    Kindly help.
    Regards,
    Karthik

    Check this thread
    it is a Big Discussion on that.
    In first page and second page you can see solutions.
    /thread/747643 [original link is broken]
    one with patch and other with setting in Adobe.
    Regards
    Vijay babu Dudla

Maybe you are looking for

  • Creating new instances

    Hi all, quick query, I need to get a parameter passed to a method to reference a new instance of another class... how can i do this? Thanks

  • Download of Blackberry Desktop fails

    tried several times to download the desktop software, various versions but it always ends with this message when i get to the last download button: Access Denied You don't have permission to access "http://swdownload-us.rim.com.edgesuite.net/swdownlo

  • Photoshop cs5 crashes windows XP

    photoshop cs5 crashes windows XP

  • Testing OData Service on SMP3

    Here's what I've done so far: Created an OData model in GWPA, deployed to SMP3 Integration Gateway, wide open access, I can pull up the service document on the Integration Gateway, I created an application definition in the Admin Cockpit, created a S

  • SNDS and Slftware Deployment Manager

    Hi, I just installed Sneak Preview SAP NetWeaver 2004 Slim Edition and tried to use the Netweaver Developer Studio (version 2.0.11). To get the Studio working I need to have SDM (Software Deployment Manager) should be installed as well. Can somebody