Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel PageSetup Error even when a printer Exists
Hi,
we run batch jobs to create Excel document. The code worked fine in XP but in Win 2k it fails wiht the following error: Description: Unable to set the Orientation property of the PageSetup class I have a default printer installed and the job complets some times but most of the time it fails. The printer has all the required [its a XEROX workstation] properties but the job failes. there are looot of addins that formats their final excel document and most of them failes. here is a sample code: With ActiveWorkbook For Each wsSheet In .Worksheets ' Go through all worksheets With wsSheet With .PageSetup ' Set PageSetup properties If (lOrientation 0) Then .Orientation = lOrientation 'its a long and value is 2 If bCenterHorizontally Then ..CenterHorizontally = True If bCenterVertically Then .CenterVertically = True If Len(sTitleRows) 0 Then .PrintTitleRows = sTitleRows If Len(sTitleColumns) 0 Then ..PrintTitleColumns = sTitleColumns If Len(sPrintArea) 0 Then .PrintArea = sPrintArea If dTopMargin 0 Then .TopMargin = dTopMargin If dBottomMargin 0 Then .BottomMargin = dBottomMargin If dLeftMargin 0 Then .LeftMargin = dLeftMargin If dRightMargin 0 Then .RightMargin = dRightMargin End With End With Next wsSheet End With do we need to change any settings in the system??? can any one help in this??? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel PageSetup Error even when a printer Exists
Jo,
What Debug.Print lOrientation = xlLandscape show ? NickHk "jo" wrote in message oups.com... Hi, we run batch jobs to create Excel document. The code worked fine in XP but in Win 2k it fails wiht the following error: Description: Unable to set the Orientation property of the PageSetup class I have a default printer installed and the job complets some times but most of the time it fails. The printer has all the required [its a XEROX workstation] properties but the job failes. there are looot of addins that formats their final excel document and most of them failes. here is a sample code: With ActiveWorkbook For Each wsSheet In .Worksheets ' Go through all worksheets With wsSheet With .PageSetup ' Set PageSetup properties If (lOrientation 0) Then .Orientation = lOrientation 'its a long and value is 2 If bCenterHorizontally Then .CenterHorizontally = True If bCenterVertically Then .CenterVertically = True If Len(sTitleRows) 0 Then .PrintTitleRows = sTitleRows If Len(sTitleColumns) 0 Then .PrintTitleColumns = sTitleColumns If Len(sPrintArea) 0 Then .PrintArea = sPrintArea If dTopMargin 0 Then .TopMargin = dTopMargin If dBottomMargin 0 Then .BottomMargin = dBottomMargin If dLeftMargin 0 Then .LeftMargin = dLeftMargin If dRightMargin 0 Then .RightMargin = dRightMargin End With End With Next wsSheet End With do we need to change any settings in the system??? can any one help in this??? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel 2002/Windows XP - PageSetup error | Excel Programming | |||
Using .pagesetup with no installed printer | Excel Programming | |||
Help - Error: Unable to set the PrintArea property of the PageSetup class | Excel Programming | |||
pagesetup 1004 error | Excel Programming | |||
Printer error building Excel workbook...? | Excel Programming |