Solved

How do I set printing options that work for Excel 2003 created in Access 2003 with VBA

Posted on 2014-12-15
3
134 Views
Last Modified: 2014-12-16
I am trying to code a spreadsheet from Access 2003 that will print in landscape on a 1-wide format.  I can get the landscape setting but the code for 1-wide is not working or holding in the saved spreadsheet.  I am trying with the following code:
    xlsSheet.pagesetup.Orientation = xllandscape
'    xlsSheet.pagesetup.printgridlines = True
    xlsSheet.pagesetup.printheadings = True
    xlsSheet.pagesetup.leftheader = "Weekly Handbag Report"
    xlsSheet.pagesetup.rightheader = "&D &T"
    xlsSheet.pagesetup.PrintArea = "A2:P" & LastLine
'    xlsSheet.pagesetup.FitToPagesTall = ""
    xlsSheet.pagesetup.fittopageswide = 1
    xlsSheet.Activate
    xlsSheet.pagesetup.printtitlerows = activesheet.rows(1).Address
0
Comment
Question by:BFOG
3 Comments
 
LVL 18

Accepted Solution

by:
SimonAdept earned 200 total points
ID: 40501733
I think you need
        .FitToPagesWide = 1
        .FitToPagesTall = False
0
 
LVL 26

Assisted Solution

by:Nick67
Nick67 earned 300 total points
ID: 40501734
You missed a small detail
xlsSheet.PageSetup.Zoom = False
The default must be true.  Set it, and your code works

From the O2003 help
FitToPagesWide Property
Returns or sets the number of pages wide the worksheet will be scaled to when it's printed. Applies only to worksheets. Read/write Variant.
Remarks
If this property is False, Microsoft Excel scales the worksheet according to the FitToPagesTall property.
If the Zoom property is True, the FitToPagesWide property is ignored.
Example
This example causes Microsoft Excel to print Sheet1 exactly one page wide and tall.
With Worksheets("Sheet1").PageSetup
    .Zoom = False
    .FitToPagesTall = 1
    .FitToPagesWide = 1
End With

0
 

Author Comment

by:BFOG
ID: 40503377
I tried both; together they worked.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

Suggested Solutions

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Viewers will learn how the fundamental information of how to create a table.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now