Is there a limit on the length of a PrintArea?

C

Chuck M

Hi,

I have a worksheet that can contain anywhere from 22 to 40 embedded charts.
I am trying to create code that sets non contiguous <sp> print ranges so that
each chart will print on it's own page. Each chart is 51R x 22C. When the
length of the print range string I've built exceeds 255 characters I get a RT
1004 error "Unable to set the PrintArea property....". Does anyone know of a
way around this limitation or suggest an alternative way to accomplish the
task?
 
J

Jim Cone

A different approach...

Sub PrintCharts()
Dim chtObj As Excel.ChartObject
For Each chtObj In ActiveSheet.ChartObjects
chtObj.Chart.PrintOut
Next
Set chtObj = Nothing
End Sub
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"Chuck M" <[email protected]>
wrote in message
Hi,
I have a worksheet that can contain anywhere from 22 to 40 embedded charts.
I am trying to create code that sets non contiguous <sp> print ranges so that
each chart will print on it's own page. Each chart is 51R x 22C. When the
length of the print range string I've built exceeds 255 characters I get a RT
1004 error "Unable to set the PrintArea property....". Does anyone know of a
way around this limitation or suggest an alternative way to accomplish the
task?
 
C

Chuck M

Hi Jim. I like your approach. Thanks! I'd like to take this one step further
to see if each chart could be a separate page in one main document. The
charts are to be emailed to multiple receipients on a monthly basis. One
large document would be easier to handle. I know I didn't explain this in my
original post. Any thoughts?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top