WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE with Excel
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Excel Print Landscape Scaled problem


Question:

I am trying to setup an Excel table with the the print layout to be Landscape and scale the output so that the table width fits onto a single page.

I added the .Orientation property and that fixed the landscape.

The .FitToPagesTall/Wide appear to setup the parameters for the scaling but when you print preview the FitToPage parameters are set but the Scale Adjust option is ticked so these parameters are ignored.

I decided to set the .Zoom property to False but I keep receiving the error "Unable to set the Zoom Property of the PageSetup Class".

What am I doing wrong?

Below is the code I am using to setup the print:

ObjPage = ActiveSheet.PageSetup()
ObjPage.Orientation = xlLandscape
ObjPage.FitToPagesTall = 10
ObjPage.FitToPagesWide = 1
ObjPage.Zoom = @False

Answer:

The Excel does not programmatically provide detailed type information for the Zoom property. It will accept either a boolean or a number so you probably need to help WB out a little. Try using the ObjectType function to specify that you want the @False to be interpreted as a boolean.
ObjPage.Zoom = ObjectType("BOOL", @FALSE)

User Reply:

Many Thanks That has fixed the Problem.
Article ID:   W17153
File Created: 2007:07:03:14:28:30
Last Updated: 2007:07:03:14:28:30