Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Aug 2010
    Location
    Denmark
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi

    I'm having problems with converting/printing a worksheet in EXCEL to PDF and automatically save it on a predefined location. Well, actually, I have figured how to do exactly that, but the generated PDF-file does not work: Adobe reader says the file is damaged.

    I'm using PDF995 (alternative Adobe's owne pdf-printer). I can't install other PDF-printers do to security restrictions on my PC.

    Here is the code:
    Application.ActivePrinter = "PDF995 på Ne01:"
    ActiveWindow.SelectedSheets.PrintOut Copies:=1, ActivePrinter:= _
    "PDF995 på Ne00:", collate:=True, printtofile:=True, PrToFileName:="F:\PDFtest.pdf"

    When I open PDFtest.pdf Adobe Reader says:
    "Adobe Reader could not open "PDFtest.pdf" because it is either not a supported file type or because the file has been damaged"

    What am I doing wrong? Can you guys help me?

    Best regards
    Jonas

  2. #2
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts
    When you manually print an excel file using PDF995 - does it work?
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    Quote Originally Posted by Jonas Christensen View Post
    When I open PDFtest.pdf Adobe Reader says:
    "Adobe Reader could not open "PDFtest.pdf" because it is either not a supported file type or because the file has been damaged"
    I assume Word generates a valid PDF if you omit this part and name the file yourself:

    Code:
    , printtofile:=True, PrToFileName:="F:\PDFtest.pdf"
    I think you might need to look up command line or parameter options for pdf995 to work around whatever Word is sending when you "print to file."

    If you have Office 2007, you could try Microsoft's add-in to generate PDFs. Surely IT would allow that (?!).

  4. #4
    New Lounger
    Join Date
    Aug 2010
    Location
    Denmark
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    jscher2000:
    Yes it works when i ommit that part.

    You refer to Word, and not Excel. I work in excel, and I'm seeking to convert a Excelsheet to PDF. Just so we are on the right track

    I will try to look in the parameter options for a solution.

    Catharine Richardson - WebGenii:
    Yes, it works when I do it manually.

  5. #5
    5 Star Lounger kmurdock's Avatar
    Join Date
    Feb 2003
    Location
    Pacific Grove, California, USA
    Posts
    716
    Thanks
    10
    Thanked 34 Times in 28 Posts
    Do any of the suggestions on this page of Excel MVP Ken Puls' site help?

    Best, Kim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •