LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default ExecuteExcel4Macro Page.Setup Runtime Error

I think you've sort of answered your own questions, but I was recently
wrestling with this exact problem. You have two 255 character limitations.
First, ExecuteExcel4Macro has that limitation on the length of string it can
execute. That's easily overcome by using it 2 or more times to set
different parts of the page setup. But then the overall length of the three
parts of the header or footer can be only 255 characters. This limit has
nothing to do with the way you're setting the header/footer. It's just an
Excel limitation that applies whether you're setting it by macro or
manually.

In my case I took the header and footer setting out of the
ExecuteExcel4Macro call and set them using straight VBA. Everything else I
still set with ExecuteExcel4Macro (for speed). Of course you still have to
check the overall header/footer length, but at least you don't have length
of the other parts of Page.Setup further limiting you.

--
Jim Rech
Excel MVP


 
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
Excel page setup Sheet Print Cells Error As... tikchye_oldLearner57 Excel Discussion (Misc queries) 2 May 16th 06 04:29 PM
Excel 2003 Macro Error - Runtime error 1004 Cow Excel Discussion (Misc queries) 2 June 7th 05 01:40 PM
Syntax Error Runtime Error '424' Object Required sjenks183 Excel Programming 1 January 23rd 04 09:25 AM
Error 1004 - unable to set the orientation of the page setup class E Sullivan Excel Programming 4 October 27th 03 02:31 PM
Unknown where is the problem on the Runtime error - Automation error wellie Excel Programming 1 July 10th 03 08:12 AM


All times are GMT +1. The time now is 06:40 AM.

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"