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.Value, Missing.Value);
}

for (int chartNum = 1; chartNum <= 2; chartNum++)
{
    chart = ((Excel.ChartObject)wsClientPatient.ChartObjects(chartNum)).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;
    }
}
0
4/28/2008 5:19:00 PM
excel.charting 18370 articles. 0 followers. Follow

1 Replies
562 Views

Similar Articles

[PageSpeed] 28

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.Value, Missing.Value);
> }
> 
> for (int chartNum = 1; chartNum <= 2; chartNum++)
> {
>     chart = ((Excel.ChartObject)wsClientPatient.ChartObjects(chartNum)).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;
>     }
> }
0
4/29/2008 2:32:01 PM
Reply:

Similar Artilces:

How do I print a Find-all search in Excel 2002?
There are many occassions when I search my spreadsheet for multiple occurence of a particular number using the "Find All" search request. I then have to write the cell references down - (this is a record of multiple payments by the way). Is ther any way to print out the search results? if they are all in one column, try <data><filters><autofilter> if they are in several columns, the advanced filter may work it is just a little more complex. "Pughy" wrote: > There are many occassions when I search my spreadsheet for multiple occurence > of a ...

Can't get clip art anymore-Publisher 2003
Just since yesterday I haven't been able to get any clipart. Instead I get "dglxasset" where the clip normally is. Before yesterday it was all OK, but I defrag'd my computer and since then I've had this problem. I have searched this forum (and others) and tried the suggestions, but they don't work. I'm thinking the clipart file might be corrupt but don't know how to fix it. I've been trying to fix it for more than 7 hours and it's really annoying me... -- vickie vickie wrote: > Just since yesterday I haven't been able to get any clipart. ...

TextBox lock
How do I stop anyone from changing values or text in a textbox? The textbox in question is linked to a cell and I dont want anyone able to click on it and change the value or text. Set the 'Enabled' property to FALSE -- Hope this helps. If it does, please click the Yes button. Thanks in advance for your feedback. Gary Brown "Pas" wrote: > How do I stop anyone from changing values or text in a textbox? > The textbox in question is linked to a cell and I dont want anyone able to > click on it and change the value or text. Many thanks it work...

Null points in a line chart
I have a set of data which I wish to display as a line chart. The problem is, the data contains both zero values and null values, and when I display the chart, the null values 'revert to zero'. How can I avoid this? Is there a way I can have some interpolated values between valid points rather than have the null values display as zeroes? If not, I would settle for no point displayed at all on the chart. Any help gladly appreciated. A matrix of =IF(a1=NULL,-1,a1) Then have the -1's off the graph. "rmellison" wrote: > I have a set of data which I wish to displa...

Sorting in Charts
Hi, is there any way to sort names in a table, alphabetically, and then have numbers in a bargraph go in descending order? Okay, I have a table with a list of people's names and then their averages. Now I want their names in alphabetical order for my table. But, in my bargraph containing their averages, I would like the bars to be in descending order. Is it possible to sort in two different ways?? The easiest way is to have two different tables: One sorted for tabular output, the other for graphical output. They could be independent tables, or you could use lookup functions to ge...

[object error] when trying to print prima crystal report
Hi all, When I try to print from a report, a messagebox with "[object error]" appears... Any ideas... ...

Po sorting by reorder number and staying in printed form
When creating a purchase order, my customer basicly loads the items from the data base from a low level stand point, and then sorts everything by "reorder number". She would like the reorder numbers to stay sorted in the asending order after she clicks at the top to sort them. when she goes to print the purchase order, right now it reverts back to the order in which it was on there in the first place. Is there a purchase order out that will stay in order? Thank You... ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions wit...

Link from Chart File to Data File / Format Problem
I have two Excel files. One file with the chart and a second file with the data range. I have the data range properly formatted with currency. When I open the file with the chart, the chart has all the numbers from the data file. However, the currency formats do not flow through from the data file to the chart file. If I open both files in memory, then the currency formats flow through fine. My question is how does one get the format from the data file to flow through to the chart file? ...

Charts #4
Hi: I have 2 columns - Visible Cost & Invisible Costs for 5 categories: Tech Cost, Facilities Cost, etc. I want to plot this in the following manner: For each category I want to plot the visible and invisible costs. The chart will have a line in between with Visible on the top in blue and invisible on bottom in red for each category. Any help is greatly appreciated. Thanks. Set up the data with categories in the first column, then Invisible, then Visible. Select a cell in the table Click on the Chart Wizard button on the toolbar Select the Column Chart type, and the stacked c...

Reinstalled Office 07: Now can't do merge to email
Hi guys, every Friday I send out a message to about 100 emails. This week I had to reinstall Vista and Office 07 and now I can't get emails to go out. The merge happens in that I can see the names being filled in but basically the messages don't get sent. They are not appearing in my outbox or sent mail. I'm on an Exchange server, but that's not new. Grateful for advice so I can get this message out urgently. Thanks in advance Jo On Jul 24, 1:48=A0pm, Boppy <therealbo...@yahoo.com> wrote: > Hi guys, every Friday I send out a message to about 100 emails. This > ...

Publish charts as PNG
Hello, The Publish process from Excel to Web transforms charts to Gif files, resulting in poor resolution quality. Is it possible to improve the quality by transforming to other pictures types or by any other means? Thanks Avi You can save a chart as *.png before posting that *.png only to Web But I don't know how to do this through>Button>Publish Sub SaveAspng() ' Saves the active chart as a png file ' Prompts for a file name and directory Dim FileName As Variant If ActiveChart Is Nothing Then MsgBox "Select a chart to export.&qu...

User entry options in Word 2007
I'm using Microsoft Word 2007, and I see two options for having a user interactively enter text into a letter: 1) {ask EventDate "Enter the Event Date"} Then later there will be some {ref EventDate} 2) MACROBUTTON noname [Click and type the Event Date] where noname is like a fake macro (none of that name exists) With Option 1, the user needs to use F9 and would need to toggle field codes to see where to do it again. With Option 2, you get a marked block to tell where to enter, but as soon as you do it, everything except the data value disappears. And you c...

Excel 2000 install "uninstalls" Outlook 2003
I do not have a full MS office suite installed on my p.c. have never needed it - just Outlook 2003 and Word 2002. OS is XP SP2. My Outlook is my "critical" program that I cannot live without so to speak and is used every day. I needed a spreadsheet program and had opportunity to buy Excel 2000 (all above board, original licenced disc). I installed it today and all seemed fine until I next tried to use Activesync with Outlook 2003... the program reported that Outlook 2003 had been "uninstalled" and that Activesync could not function(which alarmed me somewhat!). I uni...

Upgrade to Office from uninstalled Os 9 software on Intel Mac.
I have a new Intel Mac and an old version of Office 98 that runs in Os 9. Since the Intel Macs do not support Os 9 emulation I can't have the previous version of Office installed on my computer when I install an upgrade. Will this be a problem? Does the upgrading software require the previous software to be already installed on my machine or can I ugrade knowing my previous serial number? Or do I have to buy the full version of Office? Thanks, If you install Office 2004 (or v.X) by dragging the Office folder from the disc onto your hard disk, you will be asked for your previous Office ...

chart Bar with %
How I create automatically chart similar to PIE but "columns with % " without create a new table with % numbers ? thanks Marina You can make a stacked column chart which shows each column as a percentage of the total of that stack. Unfortunately there is no option to use the percentages in the data labels. - Jon ------- Jon Peltier, Microsoft Excel MVP Peltier Technical Services Tutorials and Custom Solutions http://PeltierTech.com/ _______ Marina Limeira wrote: > How I create automatically chart similar to PIE but "columns with % " > without create a ne...

TextBox????
Sending data to "accounting"formatted column in a spreadsheet froma form,appears to enter as text(no formatting whatsoever). This is a new textbox added to an old form. I've reloaded Excel 2000. Thanks for any help. Any chance you're not sending real numbers to that cell? If your data is in C12, if you put =isnumber(c12) in another cell, what do you get? if it's not a number, then the numberformat won't do anything. If this is true, maybe you can clean up the value in the textbox. worksheets("sheet1").range("C12").value = cdbl(textbox1.valu...

Forward in outlook 2002 / 2003
Hello, I have an e-mail which contains a form. This e-mail must be forwarded to a lot of recipients. I've tested some mail readers, without any problem. But, in MS Outlook 2002 / 2003, when I try to forward the message, the html code changes, converting my <form action='http://xxx' name='f'> into <form>. What I mean is that I lose the essential parameters to send the form. Of course, when I recieve the e-mail forwarded by outlook 2002/2003, and I try to submit the form, it can't be able to send the data, because it have no information about where and how ha...

Creating a chart with subtotals
I am trying to create a chart from a data list that has been subtotalled using the Excel DATA/SUBTOTALS feature. The main problem I have is that when I do this, my list of items all have "COUNT" after the name. This makes the chart look scruffy. Is there any way to overcome this? Thanks in advance Karl ...

Trouble drilling through 3D column chart in ReportViewer WinForm C
Hi, I am using ReportViewer WinForm control to show chart reports generated by RS 2008. My Visual Studio is 2008. Here is my scenario: show a 3D column chart first, then drill through when clicking on the column. I found something wrong with 3D column chart: only when you move mouse to the top plane of the 3D column(no matter it is cubic or cylinder), the cursor can change to hand and drill through is possible. When you move mouse to other surfaces of column, the mouse won't change and you can't drill through. There is no such problem when you preview chart in VS, ...

chart with with date filter
hi, i have a big amount dates with values. i want to filter those dates ("from" and "to") by my choise in a combo boxes and create a chart in the same time. thanks ...

Multiple Charts #7
Is it possible to create multiple charts from a pivot chart using the report filter? (Excel 2007). For example, I have a pivot chart set up with "State" as a report filter, thus if I want to see the chart for Texas or Florida, I select it from the report filter drop down. Now I want to "quickly" generate the chart for every state to paste into another document or presentation. Is there any way to do this? ...

Printing in excel always comes out in bold even tho bold not on
When I print in excel my work always comes out in bold even though the bold is not switched on. Any suggestions?? It could be a printer setting. Does it print in bold from other applications? Regards, Fred "Scarlett50" <Scarlett50@discussions.microsoft.com> wrote in message news:DF3BAEA1-4D22-449E-BB8F-31DD8855AF20@microsoft.com... > When I print in excel my work always comes out in bold even though the > bold > is not switched on. Any suggestions?? No only when I have to type a report in excel - the actual report is ok on other computers! but...

textbox on the screen
is it possible to view the content of the active cell on a textbox that will not go off the screen even if you scroll down or to the right? -- rp Hi Rp The formula bar will always display ythe content of the active cell. Floating objects are either modeless userforms or custom toolbars. Both can be told to do what you want, but it requires some programming. HTH. Best wishes Harald "rp" <rufinojr54@hotpop.com> skrev i melding news:%23CK2xxgpEHA.324@TK2MSFTNGP11.phx.gbl... > is it possible to view the content of the active cell on a textbox that will > not go off t...

Control charts through VBA
Hi, First of all; thanks for all the help I have got from this group already. I'm still experimenting with controlling charts through VBA. I'm trying to controll the sizing of the chart object and elements of the chart and to apply formatting based on user-defined charts in xlusrgal.xls. This is what I've got so far: Sub Diagram1() If Not ActiveChart Is Nothing Then ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:= _ "Linje1" ActiveWorkbook.Colors = Workbooks("XLUSRGAL.XLS").Colors With ActiveChart.Parent .Height ...

How many charts per file?
How many charts per file can Excel support?. What's the maximum advisable number?. Thanks. Hi Guillermo This is limited by the available memory and system ressources. HTH Cordially Pascal "Guillermo" <guillermo@engineer.com> a �crit dans le message de news:2768601c462ed$f17def30$a301280a@phx.gbl... > How many charts per file can Excel support?. > What's the maximum advisable number?. > Thanks. And by how Excel uses these resources. You can make room for more charts if you turn off automatic font scaling on the charts, as described here: http://peltie...