Search found 12 matches

by KenWhite
Tue Nov 15, 2016 4:28 pm
Forum: XLSReadWritwII 6
Topic: Adding worksheets
Replies: 1
Views: 1766

Re: Adding worksheets

To add a new sheet

Code: Select all

  // XLS is an XLSReadWriteII5 component
  XLS.Add;
  // Name it
  XLS[XLS.Count - 1].Name := 'NewName';
To get the sheet count

Code: Select all

var
  NumSheets: Integer;
begin
  NumSheets := XLS.Count;
end;
by KenWhite
Thu Jun 30, 2016 5:51 pm
Forum: XLSReadWritwII 6
Topic: Page Setup
Replies: 1
Views: 2000

Re: Page Setup

Same as you would using Excel 2007, using the XLS Workbook's WorkspaceOptions, where XLS is a TXLSReadWriteII5:

Code: Select all

  XLS[0].WorkspaceOptions := [woFitToPage];
by KenWhite
Wed May 18, 2016 1:17 pm
Forum: XLSReadWritwII 6
Topic: How to set BuiltInName to bnPrintTitles in Version 5?
Replies: 3
Views: 2936

Re: How to set BuiltInName to bnPrintTitles in Version 5?

What you're asking is now done with the PrintSettings.

Code: Select all

var
  Col1, Col2, Row1, Row2: Integer;
begin
  AreaStrToColRow('$A$1:$IV$10', Col1, Col2, Row1, Row2);
  Sheet.PrintSettings.PrintTitles(Col1, Col2, Row1, Row2);
end;
by KenWhite
Fri Mar 11, 2016 9:46 pm
Forum: XLSReadWritwII 6
Topic: XLSReadWriteII 5 destroys xls strings when writing TWideMemo
Replies: 6
Views: 5016

Re: XLSReadWriteII 5 destroys xls strings when writing TWideMemo

Lars: FYI, this question was asked at StackOverflow (http://stackoverflow.com/q/35917113/62576), and I provided code there that demonstrates that the problem is not in XLSRWII5, both by using an array of Unicode strings and an ADO table with the strings in Unicode fields. The code for both methods (...
by KenWhite
Tue Feb 09, 2016 2:07 pm
Forum: XLSReadWritwII 6
Topic: Unable to create DataBar conditional formatting
Replies: 2
Views: 2379

Re: Unable to create DataBar conditional formatting

Thanks, Lars. Works perfectly.
by KenWhite
Tue Feb 02, 2016 8:08 pm
Forum: XLSReadWritwII 6
Topic: Unable to create DataBar conditional formatting
Replies: 2
Views: 2379

Unable to create DataBar conditional formatting

XLSReadWriteII5 v5.20.69 I've been trying for the last several hours to apply simple DataBar conditional formatting to a range of cells without success. I've tried various combinations of values in everything I can find to no avail. I've been looking inside the workbook at the resulting XML to see i...
by KenWhite
Tue Feb 02, 2016 4:11 pm
Forum: XLSReadWritwII 6
Topic: Exception raised when setting PrintTitles after sheet rename
Replies: 1
Views: 1755

Exception raised when setting PrintTitles after sheet rename

I'm using XLSReadWriteII5 v5.20.69. I'm getting an exception when I try to set PrintTitles after the sheet is renamed. It works fine if I set PrintTitles first. Here's an example that demonstrates: program Project1; {$APPTYPE CONSOLE} uses SysUtils, XLSReadWriteII5; var XLS: TXLSReadWriteII5; i: Int...
by KenWhite
Tue Jan 26, 2016 6:19 pm
Forum: XLSReadWritwII 6
Topic: Misspelled procedure name in XLSSheetData5 (v5.20.69)
Replies: 2
Views: 2518

Misspelled procedure name in XLSSheetData5 (v5.20.69)

There is a typo in XLSSheetData5, in a method name for TXLSWorksheet: procedure ClearCell(const ACol, ARow: integer); procedure CelarCells(const ACol1, ARow1, ACol2, ARow2: integer); // Should be ClearCells As this not only hides the method name from Code Insight in the IDE, but makes it impossible ...
by KenWhite
Wed Dec 23, 2015 2:46 pm
Forum: XLSReadWritwII 6
Topic: XlsReadwriteII5 FillPatternForeColor use
Replies: 1
Views: 2261

Re: XlsReadwriteII5 FillPatternForeColor use

You really should learn to read source code.

Code: Select all

XLS[0].Cells[2,3].FillPatternForeColorRGB := $AFAFAF;
by KenWhite
Wed Dec 23, 2015 2:45 pm
Forum: XLSReadWritwII 6
Topic: XlsReadWriteII5 > ApplyFormat.Box
Replies: 1
Views: 2266

Re: XlsReadWriteII5 > ApplyFormat.Box

XLS.CmdFormat.Border - use

Code: Select all

XLS.CmdFormat.BeginEdit[XLS[0]);
XLS.CmdFormat.Border.Preset(cbspOutline); 
See the other properties of

Code: Select all

CmdFormat
, such as

Code: Select all

BorderLeftColor
.
by KenWhite
Tue Aug 15, 2006 2:49 pm
Forum: XLSReadWriteII 3/4/5
Topic: Question about Chinese and Portuguese
Replies: 3
Views: 3230

Ken,

Remove the AnsiString typecast. You're converting it basically the same way AsString would.