Default Format and Multiple Tabs
Posted: Wed Oct 22, 2014 3:11 pm
Hello,
I'm trying to upgrade our XLS library to XLSReadWriteII5 and have hit problems with the default formats. Previously (with .xls files) the default was Arial and size 10, but after the upgrade the default seems to be Calibri and size 11. I'm trying to prevent this change to avoid users complaining.
I've applied the following code shortly after creating the object:
This works fine for all text on the first tab, but once that tab's finished I add a new tab using oXLS.Add, but all text on the subsequent tabs revert back to Calibri size 11. I've tried reusing the code above after adding the new sheet, passing the new TXLSWorksheet to BeginEdit, calling AddAsDefault with a unique name, or simply trying to set the DefaultFormat using the format I added at creation time, but nothing seems to work.
Is there a line of code I'm missing somewhere so the new tabs use the defaults from the first?
Many thanks,
James
I'm trying to upgrade our XLS library to XLSReadWriteII5 and have hit problems with the default formats. Previously (with .xls files) the default was Arial and size 10, but after the upgrade the default seems to be Calibri and size 11. I'm trying to prevent this change to avoid users complaining.
I've applied the following code shortly after creating the object:
Code: Select all
oXLS.CmdFormat.BeginEdit(nil);
oXLS.CmdFormat.Font.Name := 'Arial';
oXLS.CmdFormat.Font.Size := 10;
oXLS.CmdFormat.AddAsDefault('ExcelDef');
oXLS.DefaultFormat := oXLS.CmdFormat.Defaults.Find('ExcelDef');
Is there a line of code I'm missing somewhere so the new tabs use the defaults from the first?
Many thanks,
James