ADAdministrator Syncfusion Team April 24, 2004 01:40 AM
Here is the code snippet for getting the Standard font. But there seems to be a bug because its returning "Tahoma" all the time. I will isvestigate more into this issue and get it fixed.
ExcelEngine excelEngine = new ExcelEngine();
IApplication application = excelEngine.Excel;
IWorkbook myWorkbook = excelEngine.Excel.Workbooks.Open("Template.xls");
IWorksheet mySheet = myWorkbook.Worksheets;
string fontName = mySheet.Application.StandardFont;
excelEngine.ThrowNotSavedOnDestroy = false;
Sorry for the inconvenience. Please let me know if you have any other questions. Thanks.
>ExcelRW supports a standard column width and row height for undefined cells, but I cannot find the standard font information used for all undefined cells.
GRGregApril 24, 2004 09:02 AM
Aha! Hiding it under the .Application, while the height and width is available directly under the Worksheet. ;-) I hadn''t looked under Application before, but I will now.
It seems to me that this is not an Application property but a Workbook property, as each file will remember its own standard.
ADAdministrator Syncfusion Team May 18, 2004 12:07 PM
I looked it into this issue and it seems that the standard font is an application level setting. Here is a simple test.
1) Go to Tools >> Option >> General Tab and then set the standard font to TimesNewRoman
2) Close the excel spreadsheet. Then create a new spreadsheet.
3) Again change the standard font settings to Arial thro Tools >> Options and close the workbook.
4) Now try opening the spreadsheet that you had originally created using TimesNewRoman as the standard font, and go to Tools >> Options, it will display the standard font as Arial.
Please let me know if i am missing something. Thanks.
>Aha! Hiding it under the .Application, while the height and width is available directly under the Worksheet. ;-) I hadn''t looked under Application before, but I will now.
>It seems to me that this is not an Application property but a Workbook property, as each file will remember its own standard.
GRGregMay 18, 2004 01:47 PM
You are correct; this is an application level variable in Excel. Still odd, I say.
Glad you''re looking into these issues again, as this indicates you may be testing out the attempted fixes.
I recommend that you create an automated regression testing system in which you have an increasing number of excel files that your scripts read, write back, and compare. If you can create scripts that encompass all of the properties and methods of the ExcelRW, then you''ll have a good attempt at good coverage, and a test bank to compare to ensure that future changes do not disrupt what already works.