A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Charts and Charting
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Textbox on chart doesn't print in Office 2003, but does in 2007



 
 
Thread Tools Display Modes
  #1  
Old April 28th, 2008, 06:19 PM posted to microsoft.public.excel.charting
Jeff Donkersgoed
external usenet poster
 
Posts: 2
Default Textbox on chart doesn't print in Office 2003, but does in 2007

I have some charts that I create through C# code on a "template" worksheet
and then copy it over to a new worksheet using the following code. When
looking at the chart.Shapes, I can see the three Textbox objects that I want
and these are the only shapes available. I can see them on the screen in
both Excel 2003 and 2007 correctly. When I print in 2003 though, the
textboxes don't appear like they do for 2007. Can anyone shed some light on
why this might be happening?

// Copy the images and charts (note index starts at 1)
for (int z = 1; z = wsTemplate.Shapes.Count; z++)
{
((Excel.Shape)wsTemplate.Shapes.Item(z)).Copy();
wsClientPatient.get_Range("A1", "A1").Activate();
((Excel.Worksheet)app.ActiveSheet).Paste(Missing.V alue, Missing.Value);
}

for (int chartNum = 1; chartNum = 2; chartNum++)
{
chart = ((Excel.ChartObject)wsClientPatient.ChartObjects(c hartNum)).Chart;
chart.ChartArea.Top = (chartNum == 1) ? 868 : 1047;
chart.ChartArea.Left = 25;

// Temporary test
for (int z = 1; z = chart.Shapes.Count; z++)
{
object y = chart.Shapes.Item(z);
Microsoft.Office.Core.MsoShapeType yy = chart.Shapes.Item(z).Type;
}
}
  #2  
Old April 29th, 2008, 03:32 PM posted to microsoft.public.excel.charting
Jeff Donkersgoed
external usenet poster
 
Posts: 2
Default Textbox on chart doesn't print in Office 2003, but does in 2007

I think I'm getting a bit closer...in Excel 2003, I discovered that the
"Print object" checkbox wasn't checked on my textboxes. Checking it allowed
them to show up in the print preview. Does anyone know how to set this in
code? I tried below, but the property was already set to true, so I don't
think it's the right spot. I can't find a similar checkbox in Excel 2007 to
verify.

for (int z = 1; z = chart.Shapes.Count; z++)
{
chart.Shapes.Item(z).ControlFormat.PrintObject = true;
}

"Jeff Donkersgoed" wrote:

I have some charts that I create through C# code on a "template" worksheet
and then copy it over to a new worksheet using the following code. When
looking at the chart.Shapes, I can see the three Textbox objects that I want
and these are the only shapes available. I can see them on the screen in
both Excel 2003 and 2007 correctly. When I print in 2003 though, the
textboxes don't appear like they do for 2007. Can anyone shed some light on
why this might be happening?

// Copy the images and charts (note index starts at 1)
for (int z = 1; z = wsTemplate.Shapes.Count; z++)
{
((Excel.Shape)wsTemplate.Shapes.Item(z)).Copy();
wsClientPatient.get_Range("A1", "A1").Activate();
((Excel.Worksheet)app.ActiveSheet).Paste(Missing.V alue, Missing.Value);
}

for (int chartNum = 1; chartNum = 2; chartNum++)
{
chart = ((Excel.ChartObject)wsClientPatient.ChartObjects(c hartNum)).Chart;
chart.ChartArea.Top = (chartNum == 1) ? 868 : 1047;
chart.ChartArea.Left = 25;

// Temporary test
for (int z = 1; z = chart.Shapes.Count; z++)
{
object y = chart.Shapes.Item(z);
Microsoft.Office.Core.MsoShapeType yy = chart.Shapes.Item(z).Type;
}
}

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:34 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.