Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Sep 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Print to File (Excel 97)

    We have a need to take our Excel 97 spreadsheets and post them on the Internet. Our web developers are asking that we save the spreadsheets as a postscript file and then they will convert them to a PDF. In addition, If a spreadsheet contains multiple worksheets, we want them grouped so that when we print to file, it picks them all up.

    How can we do this?

  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

    Re: Print to File (Excel 97)

    You need to have the Postscript printer driver installed. Then, when printing you select the postscript printer from your list of available printers and tell it to print to file.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  3. #3
    New Lounger
    Join Date
    Sep 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print to File (Excel 97)

    I guess I should have been clearer. We want to automate the process where a macro is created and made as an available menu option so all the user has to do is select (possibly) "Print To File" and it runs (selecting the appropriate print driver, saving the file as PS to a specific folder and includes ALL worksheets).

  4. #4
    Super Moderator WebGenii's Avatar
    Join Date
    Jan 2001
    Location
    Redcliff, Alberta, Canada
    Posts
    4,066
    Thanks
    2
    Thanked 5 Times in 5 Posts

    Re: Print to File (Excel 97)

    aaahhh! <img src=/S/blush.gif border=0 alt=blush width=15 height=15> Well since I have a huge head cold <img src=/S/headthrob.gif border=0 alt=headthrob width=15 height=15> and am not capable of intelligent thought any longer I'll let someone else grab your question.
    [b]Catharine Richardson (WebGenii)
    WebGenii Home Page
    Moderator: Spreadsheets, Other MS Apps, Presentation Apps, Visual Basic for Apps, Windows Mobile

  5. #5
    New Lounger
    Join Date
    Sep 2002
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Print to File (Excel 97)

    OK, the code below is what I've come up with to automate the process, however, it only grabs the workbook some of the times. Other times it only takes the first worksheet. Any suggestions on how to get it to always save the entire workbook?

    Sub PrintToFile()
    Dim num As Integer
    Dim wbName As String, newName As String
    Dim destDir As String, destPrinter As String
    Dim curPrinter As String

    destDir = "Q:TEMP"
    destPrinter = "QMS-PS 810 on FILE:"
    curPrinter = Application.ActivePrinter
    wbName = ActiveWorkbook.Name
    num = InStr(wbName, ".") - 1
    If num <= 0 Then
    MsgBox "File has not been saved. Activity halted."
    Exit Sub
    End If

    newName = destDir & "" & "ab" & Left(wbName,
    um) & ".ps"
    If Dir(newName) <> "" Then Kill newName

    With ActiveSheet.PageSetup
    .Zoom = 54
    End With

    SendKeys newName & "{enter}"
    ActivePrinter = destPrinter
    ActiveWorkbook.PrintOut
    Application.ActivePrinter = curPrinter
    ActiveWorkbook.Save

    End Sub

Posting Permissions

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