• Excel is nuts and acts nutty

    From Robert Baer@robertbaer@localnet.com to alt.computer on Sun Oct 3 23:04:58 2021
    On tips.net, i see:

    On Bob's system, Excel refuses to print to any printer other than the
    one set as the default for the system. This only happens in Excel, not
    in Word or any other installed application. So in order to print he has
    to temporarily change the default printer to the one he wants, print,
    and then remember to set the printer back afterwards.

    I have seen this and printing variants between versions of Excel that
    is "constant" in OSes from Win2K thru Win7.

    One can easily get scrambled, long output.
    The "demo" program below demonstrates that; a minor variation will
    indicate printing on Ne00:.

    Sub Prynt()
    '
    ' prynt Macro
    ' Macro recorded 10/3/2021 by ROBERT BAER

    pPath = "W:\OIL4LESS\ANALOG\HVREG\Boards\TITANTWO\TT_C\RevH\"


    ' *** NOTE: default printer absolutely MUST be the one you want to use ***
    ' Printer properties PORTS MUST be set properly also.

    ' In "modern" defective Excel, trys to print to default; if program
    attempts otherwise,
    ' output file has proper name, but contents are scrambled, SO must set default to what is needed.

    sPrinter = "Acrobat PDFWriter on FILE:" 'this printer does not
    exist on this system
    ActiveWindow.SelectedSheets.PrintOut ActivePrinter:=sPrinter, _
    Copies:=1, PrintToFile:=True, PrToFileName:=pPath +
    "PrintedCase1.PDF"
    ' Message is "Now printing page 1 of 1 'TestLPT.xls' on the Canon MP 280 series Printer on Ne03:"
    ' Note: Canon MP 280 series Printer is set to default and driven via
    USB002. System ASS-u-MEs file,
    ' so scrambles content.

    sPrinter = "Canon MP280 series Printer" 'this printer does
    exist, works via USB port EXCEPT here
    ActiveWindow.SelectedSheets.PrintOut ActivePrinter:=sPrinter, _
    Copies:=1, PrintToFile:=True, PrToFileName:=pPath +
    "PrintedCase2.PDF"
    ' Message is "Now printing page 1 of 1 'TestLPT.xls' on the Canon MP 280 series Printer on Ne03:"
    ' Note: ditto.

    sPrinter = "Xerox Phaser 6120 PS" 'this printer exists on this system
    ActiveWindow.SelectedSheets.PrintOut ActivePrinter:=sPrinter, _
    Copies:=1, PrintToFile:=True, PrToFileName:=pPath +
    "PrintedCase3.PDF"
    ' Message is "Now printing page 1 of 1 'TestLPT.xls' on the Xerox Phaser
    6120 PS on FILE"
    ' Note: Printer assignment must be set to FILE to work properly, else
    get scrambled content.
    ' Note: ActivePrinter = "Xerox Phaser 6120 PS on FILE:"

    Close


    End Sub
    --
    This email has been checked for viruses by Avast antivirus software. https://www.avast.com/antivirus

    --- Synchronet 3.20a-Win32 NewsLink 1.114
  • From Paul@nospam@needed.invalid to alt.computer on Mon Oct 4 02:17:39 2021
    On 10/4/2021 2:04 AM, Robert Baer wrote:
     On tips.net, i see:

     On Bob's system, Excel refuses to print to any printer other than the one set as the default for the system. This only happens in Excel, not in Word or any other installed application. So in order to print he has to temporarily change the default printer to the one he wants, print, and then remember to set the printer back afterwards.

      I have seen this and printing variants between versions of Excel that is "constant" in OSes from Win2K thru Win7.

      One can easily get scrambled, long output.
      The "demo" program below demonstrates that; a minor variation will indicate printing on Ne00:.

    Sub Prynt()
    '
    ' prynt Macro
    ' Macro recorded 10/3/2021 by ROBERT BAER

        pPath = "W:\OIL4LESS\ANALOG\HVREG\Boards\TITANTWO\TT_C\RevH\"


    ' *** NOTE: default printer absolutely MUST be the one you want to use *** '     Printer properties PORTS MUST be set properly also.

    ' In "modern" defective Excel, trys to print to default; if program attempts otherwise,
    '  output file has proper name, but contents are scrambled, SO must set default to what is needed.

       sPrinter = "Acrobat PDFWriter on FILE:"      'this printer does not exist on this system
       ActiveWindow.SelectedSheets.PrintOut ActivePrinter:=sPrinter, _
           Copies:=1, PrintToFile:=True, PrToFileName:=pPath + "PrintedCase1.PDF"
    ' Message is "Now printing page 1 of 1 'TestLPT.xls' on the Canon MP 280 series Printer on Ne03:"
    ' Note: Canon MP 280 series Printer is set to default and driven via USB002. System ASS-u-MEs file,
    '       so scrambles content.

       sPrinter = "Canon MP280 series Printer"      'this printer does exist, works via USB port EXCEPT here
       ActiveWindow.SelectedSheets.PrintOut ActivePrinter:=sPrinter, _
           Copies:=1, PrintToFile:=True, PrToFileName:=pPath + "PrintedCase2.PDF"
    ' Message is "Now printing page 1 of 1 'TestLPT.xls' on the Canon MP 280 series Printer on Ne03:"
    ' Note: ditto.

       sPrinter = "Xerox Phaser 6120 PS"   'this printer exists on this system
       ActiveWindow.SelectedSheets.PrintOut ActivePrinter:=sPrinter, _
           Copies:=1, PrintToFile:=True, PrToFileName:=pPath + "PrintedCase3.PDF"
    ' Message is "Now printing page 1 of 1 'TestLPT.xls' on the Xerox Phaser 6120 PS on FILE"
    ' Note: Printer assignment must be set to FILE to work properly, else get scrambled content.
    ' Note: ActivePrinter = "Xerox Phaser 6120 PS on FILE:"

    Close


    End Sub

    I'm seeing an attempt to output PostScript, into a file with a PDF extension.

    This would normally require an Acrobat Distiller step, to go
    from what the printer knows how to make (Postscript) to
    what Acrobat Distiller knows how to make (PDF). This can also
    be done with GhostScript, amongst other things.

    The point is, don't be feeding PostScript content to Acrobat Reader
    and expect peace and joy. It's Distiller first, then Reader.

    Paul
    --- Synchronet 3.20a-Win32 NewsLink 1.114