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

Hi,

as part of an ASP.NET-application, I am currently developing a script
which is supposed to build a spreadsheet in Excel 2003 (under W2k or
XP), fill it with data, format it and print it. Everything has already
worked nicely, until a user started working with multiple filters in
weh application. These filter-settings are supposed to be printed as
part of the title, LeftHeader, to be precise. Now when the script runs,
it comes up with an error saying something like "Cannot set the
..LeftHeader-Property of the PageSetup-Object". Somehow I then tried to
swap the assignments of LeftHeader and CenterHeader, then it would set
LeftHeader and crash with a similar error on CenterHeader. So somehow,
it seems, these two are connected?

I also tried to set LeftHeader in several steps and have now come to a
state where it would set LeftHeader 3 times (until it has approx. 180
chars) and it would crash when trying to append 60 additional
characters.

Makes me wonder if there is something like a maximum size for these
props? (Couldn't find any mention of that in the MSDN-Doc).

Or why else would it fail here? (The LeftHeader has a leading CR, so
it doesn't overlap with CenterHeader, it would go below the
CenterHeader).

Thanks

Michael

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Setting LeftHeader / CenterHeader

I believe the limit is 255.

--
Regards,
Tom Ogilvy


"MBaas" wrote:

Hi,

as part of an ASP.NET-application, I am currently developing a script
which is supposed to build a spreadsheet in Excel 2003 (under W2k or
XP), fill it with data, format it and print it. Everything has already
worked nicely, until a user started working with multiple filters in
weh application. These filter-settings are supposed to be printed as
part of the title, LeftHeader, to be precise. Now when the script runs,
it comes up with an error saying something like "Cannot set the
..LeftHeader-Property of the PageSetup-Object". Somehow I then tried to
swap the assignments of LeftHeader and CenterHeader, then it would set
LeftHeader and crash with a similar error on CenterHeader. So somehow,
it seems, these two are connected?

I also tried to set LeftHeader in several steps and have now come to a
state where it would set LeftHeader 3 times (until it has approx. 180
chars) and it would crash when trying to append 60 additional
characters.

Makes me wonder if there is something like a maximum size for these
props? (Couldn't find any mention of that in the MSDN-Doc).

Or why else would it fail here? (The LeftHeader has a leading CR, so
it doesn't overlap with CenterHeader, it would go below the
CenterHeader).

Thanks

Michael


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Setting LeftHeader / CenterHeader

Tom Ogilvy schrieb:
I believe the limit is 255.


Thanks Tom,

I've done some more experiments with my code: if I rearrange it, so
that LeftHeader is set first and then CenterHeader, I can put the full
text to LeftHeader (209 chars) and get the error-msg when trying to put
79 chars to CenterHeader.

And then I've put 252 chars into .LeftHeader - and got the error when I
tried to assign .CenterHeader="x". So it seems there is a limit
'around' 255 for the cumulated length of LeftHeader + CenterHeader?

I don't think this is documented anywhere (in easily accessible
'official' doco, that is) and of course such a restriction seems to be
rather poor for a version 2003 :((

Any ideas how I might get around?

Thanks

Michael

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Setting LeftHeader / CenterHeader

OK, case closed.

I discovered that when you this over Excels UI, you are not allowed to
enter more than 255 chars in total for Left/Center/Right and you also
get a message saying so. Pity, pity :(

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
Enter Multiple lines using .leftheader Carol Excel Discussion (Misc queries) 0 June 5th 07 05:23 PM
Pagesetup. Is there no way to control the LeftMargin of the LeftHeader ? Claus[_3_] Excel Programming 5 September 9th 05 07:56 AM
Language portability problems when setting LeftHeader text from external app (=non-VBA) DannyG Excel Programming 2 May 11th 05 08:56 AM
VBA Code to Print a Variable as part of CenterHeader Problem gvlral Excel Programming 2 January 30th 05 06:27 PM
Excel generation and PageSetup.CenterHeader lfb Excel Programming 3 February 9th 04 05:24 PM


All times are GMT +1. The time now is 06:07 PM.

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"