Print code fails after migration from 2003 to 2010

xzlaatc

New Member
Joined
Jun 15, 2009
Messages
15
My organization just moved from Office 2003 to 2010. The first problem I have encountered is that a code to setup the page and open the print preview has stopped working. Now, it just opens the preview, but ALL functions in the preview are disabled, making it impossible to complete the print job.

Any help would be greatly appreciated!

Here is a sample:

Private Sub PrintCSReportButton1_Click()
Application.ScreenUpdating = False
With ActiveSheet.PageSetup
.LeftHeader = ""
.CenterHeader = ""
.RightHeader = ""
.LeftFooter = ""
.CenterFooter = ""
.RightFooter = ""
.LeftMargin = Application.InchesToPoints(0.25)
.RightMargin = Application.InchesToPoints(0.25)
.TopMargin = Application.InchesToPoints(0.25)
.BottomMargin = Application.InchesToPoints(0.25)
.HeaderMargin = Application.InchesToPoints(0)
.FooterMargin = Application.InchesToPoints(0)
.PrintHeadings = False
.PrintGridlines = False
.PrintComments = xlPrintNoComments
'.PrintQuality = Array(300, 300)
.CenterHorizontally = True
.CenterVertically = True
.Orientation = xlLandscape
.Draft = False
'.PaperSize = xlLetter
.FirstPageNumber = xlAutomatic
.Order = xlDownThenOver
.BlackAndWhite = False
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
.PrintErrors = xlPrintErrorsDisplayed
End With
ActiveWindow.SelectedSheets.PrintOut From:=1, to:=1, Copies:=1, Preview:=True, Collate:=True
End Sub
 
Last edited:

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I don't have Excel 2010, but... can't you just record this code over again in your new Excel version? It loks like it was simply recorded to begin with.
 
Upvote 0

Forum statistics

Threads
1,216,303
Messages
6,129,983
Members
449,549
Latest member
birdguy_1930

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top