+ Reply to Thread
Results 1 to 3 of 3

Printing Problems with Spreadsheet

  1. #1
    TMesh
    Guest

    Printing Problems with Spreadsheet

    Hi

    I have written an Excel Add-In which based on the input from the client
    creates a couple of new sheets in the active workbook. The sheets created
    contain about 55 columns of data. So I format the PageSetup object as
    follows:

    'Set worksheet properties
    With xlsCostToStartReport

    'Activate the current sheet
    .Activate
    'Set the font for the sheet to Arial
    .Cells.Font.Name = "Arial"
    'Disabled wordwrap in coumn A
    .Columns("A").WrapText = False
    'Re-size range to the largest field value
    .Columns.AutoFit

    'Set PageSetup properties
    With .PageSetup
    'Set the header section of the spreadsheet
    .LeftHeader = "Case: " & m_strCaseName
    .CenterHeader = "&""Arial,Bold""&14Cost To Start Report" & Chr(10) &
    "&""Arial,Italic""&12" & cboTurbines.Text
    .RightHeader = "Date: &D" & Chr(10) & "Time : &T"
    'Set the footer section of the spreadsheet
    .LeftFooter = ""
    .CenterFooter = ""
    .RightFooter = "Page: &P of &N"
    'Set the margins of the spreadsheet
    .LeftMargin = Application.InchesToPoints(0.5)
    .RightMargin = Application.InchesToPoints(0.25)
    .TopMargin = Application.InchesToPoints(1)
    .BottomMargin = Application.InchesToPoints(0.5)
    .HeaderMargin = Application.InchesToPoints(0.5)
    .FooterMargin = Application.InchesToPoints(0.25)
    'Set the page orientation to print landscape
    .Orientation = xlLandscape
    'Set the intial paper size to be letter (8.5 x 11)
    .PaperSize = xlPaperLetter
    'Set the page numbering to automatic
    .FirstPageNumber = xlAutomatic
    'Set the columns to repeat
    .PrintTitleColumns = "$A:$B"
    'Set the print order to down and over
    .Order = xlDownThenOver
    'Turn zoom off
    .Zoom = False
    'Set the number of pages wide to three
    .FitToPagesWide = 4
    'Set the number of pages tall to be 1
    .FitToPagesTall = 1
    End With

    'Set the Visible property of the sheet to visible
    .Visible = xlSheetVisible
    'Freeze the panes to the left and top of cell B4
    .Range("$C$2").Select
    ActiveWindow.FreezePanes = True
    'Set protection password for current sheet
    .Protect "nreca!!"

    End With

    My problem is when I go and change printers from my local printer to a
    network printer. I know the output could change a little, but what is
    happening is Excel will not print the last page.

    Is this a BUG? It happens in all versions of Office I am testing with
    (2003,2002,2000).

    Any help solving this issue would be greatly appreciated.

    Tom
    [email protected]


  2. #2
    Vacation's Over
    Guest

    RE: Printing Problems with Spreadsheet

    Not sure but I have had issues with margins and header/footers on different
    printers.

    TEST: large magins - say .7 and no header or footer
    if this fixes it, then incrementally add them back to see what is causing
    the problem.


    "TMesh" wrote:

    > Hi
    >
    > I have written an Excel Add-In which based on the input from the client
    > creates a couple of new sheets in the active workbook. The sheets created
    > contain about 55 columns of data. So I format the PageSetup object as
    > follows:
    >
    > 'Set worksheet properties
    > With xlsCostToStartReport
    >
    > 'Activate the current sheet
    > .Activate
    > 'Set the font for the sheet to Arial
    > .Cells.Font.Name = "Arial"
    > 'Disabled wordwrap in coumn A
    > .Columns("A").WrapText = False
    > 'Re-size range to the largest field value
    > .Columns.AutoFit
    >
    > 'Set PageSetup properties
    > With .PageSetup
    > 'Set the header section of the spreadsheet
    > .LeftHeader = "Case: " & m_strCaseName
    > .CenterHeader = "&""Arial,Bold""&14Cost To Start Report" & Chr(10) &
    > "&""Arial,Italic""&12" & cboTurbines.Text
    > .RightHeader = "Date: &D" & Chr(10) & "Time : &T"
    > 'Set the footer section of the spreadsheet
    > .LeftFooter = ""
    > .CenterFooter = ""
    > .RightFooter = "Page: &P of &N"
    > 'Set the margins of the spreadsheet
    > .LeftMargin = Application.InchesToPoints(0.5)
    > .RightMargin = Application.InchesToPoints(0.25)
    > .TopMargin = Application.InchesToPoints(1)
    > .BottomMargin = Application.InchesToPoints(0.5)
    > .HeaderMargin = Application.InchesToPoints(0.5)
    > .FooterMargin = Application.InchesToPoints(0.25)
    > 'Set the page orientation to print landscape
    > .Orientation = xlLandscape
    > 'Set the intial paper size to be letter (8.5 x 11)
    > .PaperSize = xlPaperLetter
    > 'Set the page numbering to automatic
    > .FirstPageNumber = xlAutomatic
    > 'Set the columns to repeat
    > .PrintTitleColumns = "$A:$B"
    > 'Set the print order to down and over
    > .Order = xlDownThenOver
    > 'Turn zoom off
    > .Zoom = False
    > 'Set the number of pages wide to three
    > .FitToPagesWide = 4
    > 'Set the number of pages tall to be 1
    > .FitToPagesTall = 1
    > End With
    >
    > 'Set the Visible property of the sheet to visible
    > .Visible = xlSheetVisible
    > 'Freeze the panes to the left and top of cell B4
    > .Range("$C$2").Select
    > ActiveWindow.FreezePanes = True
    > 'Set protection password for current sheet
    > .Protect "nreca!!"
    >
    > End With
    >
    > My problem is when I go and change printers from my local printer to a
    > network printer. I know the output could change a little, but what is
    > happening is Excel will not print the last page.
    >
    > Is this a BUG? It happens in all versions of Office I am testing with
    > (2003,2002,2000).
    >
    > Any help solving this issue would be greatly appreciated.
    >
    > Tom
    > [email protected]
    >


  3. #3
    TMesh
    Guest

    RE: Printing Problems with Spreadsheet

    Vacation's Over

    Thanks for the reply.

    I tried as you suggested with no luck. But the last page still will not
    print even though the Page Break View shows the page. Page Break View shoes
    4 pages, but only three pages show in Print Preview.

    Any other thoughts?

    Tom
    [email protected]


    "Vacation's Over" wrote:

    > Not sure but I have had issues with margins and header/footers on different
    > printers.
    >
    > TEST: large magins - say .7 and no header or footer
    > if this fixes it, then incrementally add them back to see what is causing
    > the problem.
    >
    >
    > "TMesh" wrote:
    >
    > > Hi
    > >
    > > I have written an Excel Add-In which based on the input from the client
    > > creates a couple of new sheets in the active workbook. The sheets created
    > > contain about 55 columns of data. So I format the PageSetup object as
    > > follows:
    > >
    > > 'Set worksheet properties
    > > With xlsCostToStartReport
    > >
    > > 'Activate the current sheet
    > > .Activate
    > > 'Set the font for the sheet to Arial
    > > .Cells.Font.Name = "Arial"
    > > 'Disabled wordwrap in coumn A
    > > .Columns("A").WrapText = False
    > > 'Re-size range to the largest field value
    > > .Columns.AutoFit
    > >
    > > 'Set PageSetup properties
    > > With .PageSetup
    > > 'Set the header section of the spreadsheet
    > > .LeftHeader = "Case: " & m_strCaseName
    > > .CenterHeader = "&""Arial,Bold""&14Cost To Start Report" & Chr(10) &
    > > "&""Arial,Italic""&12" & cboTurbines.Text
    > > .RightHeader = "Date: &D" & Chr(10) & "Time : &T"
    > > 'Set the footer section of the spreadsheet
    > > .LeftFooter = ""
    > > .CenterFooter = ""
    > > .RightFooter = "Page: &P of &N"
    > > 'Set the margins of the spreadsheet
    > > .LeftMargin = Application.InchesToPoints(0.5)
    > > .RightMargin = Application.InchesToPoints(0.25)
    > > .TopMargin = Application.InchesToPoints(1)
    > > .BottomMargin = Application.InchesToPoints(0.5)
    > > .HeaderMargin = Application.InchesToPoints(0.5)
    > > .FooterMargin = Application.InchesToPoints(0.25)
    > > 'Set the page orientation to print landscape
    > > .Orientation = xlLandscape
    > > 'Set the intial paper size to be letter (8.5 x 11)
    > > .PaperSize = xlPaperLetter
    > > 'Set the page numbering to automatic
    > > .FirstPageNumber = xlAutomatic
    > > 'Set the columns to repeat
    > > .PrintTitleColumns = "$A:$B"
    > > 'Set the print order to down and over
    > > .Order = xlDownThenOver
    > > 'Turn zoom off
    > > .Zoom = False
    > > 'Set the number of pages wide to three
    > > .FitToPagesWide = 4
    > > 'Set the number of pages tall to be 1
    > > .FitToPagesTall = 1
    > > End With
    > >
    > > 'Set the Visible property of the sheet to visible
    > > .Visible = xlSheetVisible
    > > 'Freeze the panes to the left and top of cell B4
    > > .Range("$C$2").Select
    > > ActiveWindow.FreezePanes = True
    > > 'Set protection password for current sheet
    > > .Protect "nreca!!"
    > >
    > > End With
    > >
    > > My problem is when I go and change printers from my local printer to a
    > > network printer. I know the output could change a little, but what is
    > > happening is Excel will not print the last page.
    > >
    > > Is this a BUG? It happens in all versions of Office I am testing with
    > > (2003,2002,2000).
    > >
    > > Any help solving this issue would be greatly appreciated.
    > >
    > > Tom
    > > [email protected]
    > >


+ 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