Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default set PageSetup.PrintArea from MS Project

I'm using VBA from MS Project 2003.

I create an Excel sheet, write data to it and all works well.

Now, after writing data to it I want to set a printarea and I try the usual

with xlsheet '// being the Excelsheet creatd from MS Project
with .PageSetup
.Orientation = xlLandscape
.PrintArea = "$A$3:$N$158" '// Some address
end with
end with

while running it stops at the .Orientation statement with Error 1004
"Unable to set the Orientation property of the PageSetup class"

Adding .Activate doesn't make a difference

What could cause this problem and how to solve it?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default set PageSetup.PrintArea from MS Project

try using the number 2 instead of xlLandscape


"SoftwareTester" wrote:

I'm using VBA from MS Project 2003.

I create an Excel sheet, write data to it and all works well.

Now, after writing data to it I want to set a printarea and I try the usual

with xlsheet '// being the Excelsheet creatd from MS Project
with .PageSetup
.Orientation = xlLandscape
.PrintArea = "$A$3:$N$158" '// Some address
end with
end with

while running it stops at the .Orientation statement with Error 1004
"Unable to set the Orientation property of the PageSetup class"

Adding .Activate doesn't make a difference

What could cause this problem and how to solve it?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
PrintArea [email protected] Excel Programming 4 July 23rd 05 12:45 AM
ActiveSheet.PageSetup.PrintArea variable ? MAS Excel Programming 2 May 2nd 05 05:45 PM
Help - Error: Unable to set the PrintArea property of the PageSetup class Marie J-son[_5_] Excel Programming 3 January 5th 05 02:04 PM
PrintArea rickey24[_18_] Excel Programming 1 October 7th 04 01:48 PM
PRINTAREA Giacomo[_3_] Excel Programming 4 October 28th 03 10:43 PM


All times are GMT +1. The time now is 04:53 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"