+ Reply to Thread
Results 1 to 6 of 6

Saving an entire workbook as a PDF using VBSCript

  1. #1
    Who be dat?
    Guest

    Saving an entire workbook as a PDF using VBSCript

    Hello all!

    I'm using a VBScript file which I've added to Server 2003 scheduler to
    automatically open up Excel, load it with a workbook which is in turn
    populated with data, print it out, dynamically come up with a filename which
    is figured off of the current date and time which is then appended to the
    original filename of the workbook, save it in HTML format, then close
    itself. Works like a charm.

    I've decided I don't want to save the file in HTML format but would instead
    like to save it in PDF. The reason being is HTML files can modified by any
    with a text editor. PDF files are relatively permanent and secure which is
    what I need.

    I have Acrobat 6.0 Pro installed. I can use the print function, select
    Adobe PDF as the printer, a prompt comes up asking for a file name to save
    to, and it gets converted. At least when I do it manually it's like that.
    I thought I could figure out how to do it within VBScript easily. As it
    turns out, I'm freaking lost and have no idea how to do it. I was hoping
    some info would be on Adobe's website but I'm not finding anything.

    Anybody have any ideas? This workbook based report runs every 2 hours. I
    have to be able to create a PDF with its own filename that I assign to it
    and save it to a specified directory.

    I don't have the vbscript file I'm using to do the above with handy at the
    moment. If anyone wants it, just let me know and I'll post it later.

    Thanks all!

    Chris Smith



  2. #2
    exceluserforeman
    Guest

    RE: Saving an entire workbook as a PDF using VBSCript

    Hello,

    I do not know the vbscript for your task but, as an alternative, you can
    save the spreadsheet as a picture!
    How you may ask? see my Picture maker Utlity at:

    http://www.geocities.com/excelmarksway

    You could then insert the Sheet.gif into a web page and the Viewer need not
    have to download the file to view in Adobe Reader.

    - -Mark

    "Who be dat?" wrote:

    > Hello all!
    >
    > I'm using a VBScript file which I've added to Server 2003 scheduler to
    > automatically open up Excel, load it with a workbook which is in turn
    > populated with data, print it out, dynamically come up with a filename which
    > is figured off of the current date and time which is then appended to the
    > original filename of the workbook, save it in HTML format, then close
    > itself. Works like a charm.
    >
    > I've decided I don't want to save the file in HTML format but would instead
    > like to save it in PDF. The reason being is HTML files can modified by any
    > with a text editor. PDF files are relatively permanent and secure which is
    > what I need.
    >
    > I have Acrobat 6.0 Pro installed. I can use the print function, select
    > Adobe PDF as the printer, a prompt comes up asking for a file name to save
    > to, and it gets converted. At least when I do it manually it's like that.
    > I thought I could figure out how to do it within VBScript easily. As it
    > turns out, I'm freaking lost and have no idea how to do it. I was hoping
    > some info would be on Adobe's website but I'm not finding anything.
    >
    > Anybody have any ideas? This workbook based report runs every 2 hours. I
    > have to be able to create a PDF with its own filename that I assign to it
    > and save it to a specified directory.
    >
    > I don't have the vbscript file I'm using to do the above with handy at the
    > moment. If anyone wants it, just let me know and I'll post it later.
    >
    > Thanks all!
    >
    > Chris Smith
    >
    >
    >


  3. #3
    exceluserforeman
    Guest

    RE: Saving an entire workbook as a PDF using VBSCript

    Hello, Just a note.
    I think you need the PDF Addin then look in VB Editor Help for PDF


    "Who be dat?" wrote:

    > Hello all!
    >
    > I'm using a VBScript file which I've added to Server 2003 scheduler to
    > automatically open up Excel, load it with a workbook which is in turn
    > populated with data, print it out, dynamically come up with a filename which
    > is figured off of the current date and time which is then appended to the
    > original filename of the workbook, save it in HTML format, then close
    > itself. Works like a charm.
    >
    > I've decided I don't want to save the file in HTML format but would instead
    > like to save it in PDF. The reason being is HTML files can modified by any
    > with a text editor. PDF files are relatively permanent and secure which is
    > what I need.
    >
    > I have Acrobat 6.0 Pro installed. I can use the print function, select
    > Adobe PDF as the printer, a prompt comes up asking for a file name to save
    > to, and it gets converted. At least when I do it manually it's like that.
    > I thought I could figure out how to do it within VBScript easily. As it
    > turns out, I'm freaking lost and have no idea how to do it. I was hoping
    > some info would be on Adobe's website but I'm not finding anything.
    >
    > Anybody have any ideas? This workbook based report runs every 2 hours. I
    > have to be able to create a PDF with its own filename that I assign to it
    > and save it to a specified directory.
    >
    > I don't have the vbscript file I'm using to do the above with handy at the
    > moment. If anyone wants it, just let me know and I'll post it later.
    >
    > Thanks all!
    >
    > Chris Smith
    >
    >
    >


  4. #4
    Peter Aitken
    Guest

    Re: Saving an entire workbook as a PDF using VBSCript

    >> Hello all!
    >>
    >> I'm using a VBScript file which I've added to Server 2003 scheduler to
    >> automatically open up Excel, load it with a workbook which is in turn
    >> populated with data, print it out, dynamically come up with a filename
    >> which
    >> is figured off of the current date and time which is then appended to the
    >> original filename of the workbook, save it in HTML format, then close
    >> itself. Works like a charm.
    >>
    >> I've decided I don't want to save the file in HTML format but would
    >> instead
    >> like to save it in PDF. The reason being is HTML files can modified by
    >> any
    >> with a text editor. PDF files are relatively permanent and secure which
    >> is
    >> what I need.
    >>
    >> I have Acrobat 6.0 Pro installed. I can use the print function, select
    >> Adobe PDF as the printer, a prompt comes up asking for a file name to
    >> save
    >> to, and it gets converted. At least when I do it manually it's like
    >> that.
    >> I thought I could figure out how to do it within VBScript easily. As it
    >> turns out, I'm freaking lost and have no idea how to do it. I was hoping
    >> some info would be on Adobe's website but I'm not finding anything.
    >>
    >> Anybody have any ideas? This workbook based report runs every 2 hours.
    >> I
    >> have to be able to create a PDF with its own filename that I assign to it
    >> and save it to a specified directory.
    >>
    >> I don't have the vbscript file I'm using to do the above with handy at
    >> the
    >> moment. If anyone wants it, just let me know and I'll post it later.
    >>
    >> Thanks all!
    >>
    >> Chris Smith



    I believe that the Adobe PDF "printer" has an option to automatically print
    to XXX.pdf where xxx is the workbook name. I suggest:

    1) generating the desired PDF name (sans extension)
    2) saving the workbbok as ThatName.xls
    3) Printing to the PDF (ThatName.pdf)
    4) Resaving the workbook with its original name.
    5) Deleting ThatName.xls.

    --
    Peter Aitken

    Remove the crap from my email address before using.



  5. #5
    Forum Contributor
    Join Date
    12-14-2005
    Posts
    176
    Set up a "Watched Folder" folder using distiller - (you can open the HELP menu and enter "Watched Folder" as the search item.
    My folder was Convert PDF - then inside the folder there are 2 other folders I named "In" and "Out." "In" is the saved postscript file (XXX.ps), "Out" is where the files is moved when converted to pdf.
    Then in your EXCEL document select FILE- PRINT then check "printing to file box" - select "WORKBOOK"
    Then in the printer selection box - select "DISTILLER" as your printer.
    You might have to OPEN the DISTILLER Properites box and UNCHECK the Send "Dont Send Fonts" box.
    Make sure you have a .ps as the last part of the file name - you might have to change this manually - as I think Excel will put a .prn after the file name.

    Then you can double click the XXXXXX.ps file name and it will conver to a pdf. If you use the "Watched Folder" option and you save the XXXXX.ps file in the watched folder - it will convert automatically based upon the "time interval" you specify.
    I think you should be able to do the following in your script.
    Have the file name as XXXXXX.ps
    Save the file to your named "Watched folder"

    Also you might check out www.planetpdf.com - as there is a bunch of stuff there about pdf.

  6. #6
    Britt
    Guest

    Re: Saving an entire workbook as a PDF using VBSCript

    I would be interested in talking a look at the vbasript file, perhaps
    then i might be able to see what is going on.


+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1