How to create Validation List in Excel using XLSReadWriteII5
Posted: Wed Jan 21, 2015 12:26 pm
Hello All,
I am trying to create validation list in Excel file (.xlsx) using XLSReadWriteII5 Component. I am using Delphi6. I have managed to install this component in Delphi 6 environment and now facing difficulty in creating Validation List. I am working on Demo version and download the setup from axolot site. As per my knowledge I am working on version 50.20.41. I have seen that there are some validation related issue fixed in the version 50.20.13 in the change log. How to download specific version of XLS Suit. Currently we are evaluating the product.
This is my code.
I have also added the same question in Stackoverflow. Please refer the Url.
http://stackoverflow.com/questions/2806 ... adwriteii5
Where to find details documentation/Help of XLSReadWriteII5 component. ? Thanks in advance.
I am trying to create validation list in Excel file (.xlsx) using XLSReadWriteII5 Component. I am using Delphi6. I have managed to install this component in Delphi 6 environment and now facing difficulty in creating Validation List. I am working on Demo version and download the setup from axolot site. As per my knowledge I am working on version 50.20.41. I have seen that there are some validation related issue fixed in the version 50.20.13 in the change log. How to download specific version of XLS Suit. Currently we are evaluating the product.
This is my code.
Code: Select all
var
LwWorksheet : TXLSWorksheet;
LValidation: TXLSDataValidation;
LCell :TXLSCell;
begin
LwWorksheet:= XLS.Add;
try
LwWorksheet.Name:= 'This is a test';
LwWorksheet.AsString[1,1] := 'This is a test';
//Populate dummy data .
LwWorksheet.AsString[3,2] := 'A';
LwWorksheet.AsString[3,3] := 'B';
LwWorksheet.AsString[3,4] := 'C';
LwWorksheet.AsString[2,2] := 'A';
LwWorksheet.AsString[2,3] := 'B';
LwWorksheet.AsString[2,4] := 'C';
LwWorksheet.AsString[4,2] := 'A';
LwWorksheet.AsString[4,3] := 'B';
LwWorksheet.AsString[4,4] := 'C';
LValidation:= LwWorksheet.Validations.Add;
LValidation.Areas.Add(5,5);
LValidation.Formula1:='$B$2:$B$4';
// I don't understand the purpose of Sqref.add and I simply passed some parameter in it.
LValidation.Sqref.Add(5,5);
LValidation.Type_:= x12dvtList;
LValidation.ShowDropDown:= True;
LValidation.ShowInputMessage:= True;
LValidation.AllowBlank:= False;
finally
LwWorksheet.Free;
end;//try...finally...
http://stackoverflow.com/questions/2806 ... adwriteii5
Where to find details documentation/Help of XLSReadWriteII5 component. ? Thanks in advance.