P
P Dev
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?
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?