Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Generated file--charts squish when saved in .xls format, ok in .xl
I've got a c# program that's used to dynamically create spreadsheets. At the
end, I save the workbook both as an .xlsx file as well as a .xls file. My problem is that the charts in the .xls file, although the box remains the same size, the contents (bars, height of the vertical axis) get "squished"--that is, there is more space in the bottom half then there should be causing the rest to resize to fit (happens most noticably vertically, but also slightly horizontally). I've narrowed it down to finding out that the presence of textboxes in the chart "causes" it to squish. If I don't have the textboxes, the chart appears normal. Can anyone think of something that may cause this? I'm opening both files in Excel 2007. Here is the code relating to text box creation I'm using: Excel.Shape label = chartobj.Chart.Shapes.AddLabel(Microsoft.Office.Co re.MsoTextOrientation.msoTextOrientationHorizontal , 75, 15, 140, 140); label.Select(Type.Missing); label.TextFrame.Characters(Missing.Value, Missing.Value).Text = "Very High Risk"; label.TextFrame.AutoSize = true; label.ControlFormat.PrintObject = true; chartobj.Chart.ChartArea.AutoScaleFont = false; Excel.TextBoxes textBoxes = (Excel.TextBoxes)chartobj.Chart.TextBoxes(Type.Mis sing); textBoxes.Font.Name = "Arial"; textBoxes.Font.Size = 16; textBoxes.AutoScaleFont = false; textBoxes.PrintObject = true; |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Format Cells dialog is not displayed when file generated with XLS | Excel Programming | |||
Number Format on Excel File saved from .html file | Excel Discussion (Misc queries) | |||
Capture Events on programmatically generated Charts | Excel Programming | |||
What format are files saved in when printing to a file from Excel | Excel Programming | |||
Open file saved in HTML format | Excel Programming |