Solved

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

Posted on 2014-12-15
3
170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 18

Accepted Solution

by:
Simon 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

728 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