Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default PageSetup Class

I'm using the PageSetup class (late binding) in my application to set the
following.

ActiveSheet.PageSetup.Orientation = 2 ' Landscape
ActiveSheet.PageSetup.LeftMargin = 36
ActiveSheet.PageSetup.RightMargin = 36
ActiveSheet.PageSetup.TopMargin = 54
ActiveSheet.PageSetup.BottomMargin = 54
ActiveSheet.PageSetup.RightFooter = "Page &P of &N"

However, it depends on which environment I run the application as to whether
or not it works.

OS Excel Result
Windows XP Pro v2002 SP2 2003 (11.6355.6360) SP1 Always Works
Windows NT SP4 2003 (11.6355.6360) SP1 Does Not Work
Windows XP Pro v2002 SP2 2002 (10.6501.6735) SP3 Does Not Work

When it doesn't work, I receive the error message
"Unable to set the Orientation property of the PageSetup class"

If I comment out the Orientation property line, I receive the error message
"Unable to set the LeftMargin property of the PageSetup class"

Only when I comment out all the lines, will the application run without
error under the environments mentioned above.

Any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default PageSetup Class

Maybe grabbing at straws a bit here, but check References in the VBE
(ToolsReferences), and if there are any, uncheck them.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"P Dev" wrote in message
...
I'm using the PageSetup class (late binding) in my application to set the
following.

ActiveSheet.PageSetup.Orientation = 2 ' Landscape
ActiveSheet.PageSetup.LeftMargin = 36
ActiveSheet.PageSetup.RightMargin = 36
ActiveSheet.PageSetup.TopMargin = 54
ActiveSheet.PageSetup.BottomMargin = 54
ActiveSheet.PageSetup.RightFooter = "Page &P of &N"

However, it depends on which environment I run the application as to

whether
or not it works.

OS Excel Result
Windows XP Pro v2002 SP2 2003 (11.6355.6360) SP1 Always Works
Windows NT SP4 2003 (11.6355.6360) SP1 Does Not Work
Windows XP Pro v2002 SP2 2002 (10.6501.6735) SP3 Does Not Work

When it doesn't work, I receive the error message
"Unable to set the Orientation property of the PageSetup class"

If I comment out the Orientation property line, I receive the error

message
"Unable to set the LeftMargin property of the PageSetup class"

Only when I comment out all the lines, will the application run without
error under the environments mentioned above.

Any ideas?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default PageSetup Class

I'm sorry, but I forgot to clarify that this is a VB.Net application.

"Bob Phillips" wrote:

Maybe grabbing at straws a bit here, but check References in the VBE
(ToolsReferences), and if there are any, uncheck them.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"P Dev" wrote in message
...
I'm using the PageSetup class (late binding) in my application to set the
following.

ActiveSheet.PageSetup.Orientation = 2 ' Landscape
ActiveSheet.PageSetup.LeftMargin = 36
ActiveSheet.PageSetup.RightMargin = 36
ActiveSheet.PageSetup.TopMargin = 54
ActiveSheet.PageSetup.BottomMargin = 54
ActiveSheet.PageSetup.RightFooter = "Page &P of &N"

However, it depends on which environment I run the application as to

whether
or not it works.

OS Excel Result
Windows XP Pro v2002 SP2 2003 (11.6355.6360) SP1 Always Works
Windows NT SP4 2003 (11.6355.6360) SP1 Does Not Work
Windows XP Pro v2002 SP2 2002 (10.6501.6735) SP3 Does Not Work

When it doesn't work, I receive the error message
"Unable to set the Orientation property of the PageSetup class"

If I comment out the Orientation property line, I receive the error

message
"Unable to set the LeftMargin property of the PageSetup class"

Only when I comment out all the lines, will the application run without
error under the environments mentioned above.

Any ideas?




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default PageSetup Class

Then I'm outa here I am afraid :-)

Bob


"P Dev" wrote in message
...
I'm sorry, but I forgot to clarify that this is a VB.Net application.

"Bob Phillips" wrote:

Maybe grabbing at straws a bit here, but check References in the VBE
(ToolsReferences), and if there are any, uncheck them.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"P Dev" wrote in message
...
I'm using the PageSetup class (late binding) in my application to set

the
following.

ActiveSheet.PageSetup.Orientation = 2 ' Landscape
ActiveSheet.PageSetup.LeftMargin = 36
ActiveSheet.PageSetup.RightMargin = 36
ActiveSheet.PageSetup.TopMargin = 54
ActiveSheet.PageSetup.BottomMargin = 54
ActiveSheet.PageSetup.RightFooter = "Page &P of &N"

However, it depends on which environment I run the application as to

whether
or not it works.

OS Excel Result
Windows XP Pro v2002 SP2 2003 (11.6355.6360) SP1 Always Works
Windows NT SP4 2003 (11.6355.6360) SP1 Does Not Work
Windows XP Pro v2002 SP2 2002 (10.6501.6735) SP3 Does Not Work

When it doesn't work, I receive the error message
"Unable to set the Orientation property of the PageSetup class"

If I comment out the Orientation property line, I receive the error

message
"Unable to set the LeftMargin property of the PageSetup class"

Only when I comment out all the lines, will the application run

without
error under the environments mentioned above.

Any ideas?






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default PageSetup Class

No idea about .Net
But does the code work in VBA on all the OS's ?
At least narrow it down to culprit.

NickHK

"P Dev" wrote in message
...
I'm sorry, but I forgot to clarify that this is a VB.Net application.

"Bob Phillips" wrote:

Maybe grabbing at straws a bit here, but check References in the VBE
(ToolsReferences), and if there are any, uncheck them.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"P Dev" wrote in message
...
I'm using the PageSetup class (late binding) in my application to set

the
following.

ActiveSheet.PageSetup.Orientation = 2 ' Landscape
ActiveSheet.PageSetup.LeftMargin = 36
ActiveSheet.PageSetup.RightMargin = 36
ActiveSheet.PageSetup.TopMargin = 54
ActiveSheet.PageSetup.BottomMargin = 54
ActiveSheet.PageSetup.RightFooter = "Page &P of &N"

However, it depends on which environment I run the application as to

whether
or not it works.

OS Excel Result
Windows XP Pro v2002 SP2 2003 (11.6355.6360) SP1 Always Works
Windows NT SP4 2003 (11.6355.6360) SP1 Does Not Work
Windows XP Pro v2002 SP2 2002 (10.6501.6735) SP3 Does Not Work

When it doesn't work, I receive the error message
"Unable to set the Orientation property of the PageSetup class"

If I comment out the Orientation property line, I receive the error

message
"Unable to set the LeftMargin property of the PageSetup class"

Only when I comment out all the lines, will the application run

without
error under the environments mentioned above.

Any ideas?








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default PageSetup Class

For anyone who's interested, the problem ended up being that the computers
where the code did not work, did not have a default printer set up. Once a
default printer was added, the code worked fine!

"P Dev" wrote:

I'm sorry, but I forgot to clarify that this is a VB.Net application.

"Bob Phillips" wrote:

Maybe grabbing at straws a bit here, but check References in the VBE
(ToolsReferences), and if there are any, uncheck them.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"P Dev" wrote in message
...
I'm using the PageSetup class (late binding) in my application to set the
following.

ActiveSheet.PageSetup.Orientation = 2 ' Landscape
ActiveSheet.PageSetup.LeftMargin = 36
ActiveSheet.PageSetup.RightMargin = 36
ActiveSheet.PageSetup.TopMargin = 54
ActiveSheet.PageSetup.BottomMargin = 54
ActiveSheet.PageSetup.RightFooter = "Page &P of &N"

However, it depends on which environment I run the application as to

whether
or not it works.

OS Excel Result
Windows XP Pro v2002 SP2 2003 (11.6355.6360) SP1 Always Works
Windows NT SP4 2003 (11.6355.6360) SP1 Does Not Work
Windows XP Pro v2002 SP2 2002 (10.6501.6735) SP3 Does Not Work

When it doesn't work, I receive the error message
"Unable to set the Orientation property of the PageSetup class"

If I comment out the Orientation property line, I receive the error

message
"Unable to set the LeftMargin property of the PageSetup class"

Only when I comment out all the lines, will the application run without
error under the environments mentioned above.

Any ideas?




  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PageSetup Class

Thank you so much for the reply! It saved me in a very critical situation :)

Cheers,
Ajith Kumar
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PageSetup Class

Thanks a zillion ton!

We had similar problem since months, now rectified!

url:http://www.ureader.com/msg/103711516.aspx
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PageSetup Class

Thanks from me too. This problem was driving me crazy - the code worked on
one computer but never on another. This fixed it.

url:http://www.ureader.com/msg/103711516.aspx
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default PageSetup Class

Hi -

I have the EXACT same problem and is driving me NUTS. I copied the URL
below that "worked" for you and another person and I just go back to the
same posting. What was the actual fix?

THe URL below just brings me back to the original post:
http://www.ureader.com/msg/103711516.aspx

url:http://www.ureader.com/msg/103711516.aspx
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
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
Unable to set the PaperSize property of the PageSetup class [email protected] Excel Programming 2 November 22nd 04 03:43 PM
Unable to Set LeftFooter Property Class PageSetup (ASP) fredlankovich Excel Programming 0 June 23rd 04 07:56 PM
Unable to set the PrintQuality property of the PageSetup class. No Name Excel Programming 1 January 14th 04 04:43 PM
RaiseEvent from a class contained in a 2nd class collection? Andrew[_16_] Excel Programming 2 January 6th 04 04:22 PM


All times are GMT +1. The time now is 10:14 PM.

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

About Us

"It's about Microsoft Excel"