We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Standard Font info

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. Thanks, Greg

4 Replies

AD Administrator Syncfusion Team April 24, 2004 01:40 AM

Hi Greg, 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[0]; string fontName = mySheet.Application.StandardFont; MessageBox.Show(fontName.ToString()); myWorkbook.Close(); excelEngine.ThrowNotSavedOnDestroy = false; excelEngine.Dispose(); Sorry for the inconvenience. Please let me know if you have any other questions. Thanks. Best regards, Stephen. >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. > >Thanks, >Greg >


GR Greg April 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. Thanks, Greg


AD Administrator Syncfusion Team May 18, 2004 12:07 PM

Hi Greg, 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. Best regards, Stephen. >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. > >Thanks, >Greg >


GR Greg May 18, 2004 01:47 PM

Stephen, 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. Good Luck, Greg

Loader.
Live Chat Icon For mobile
Up arrow icon