 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
bakker Guest
|
Posted: Thu Sep 16, 2004 7:31 am Post subject: Validating data in excel |
|
|
I want to validate entered data in a cell with a formula.
var
Wk : _Worksheet;
begin
//apExcel is a TExcelApplication
apExcel.Disconnect;
apExcel.WorkBooks.Add( null, 0 );
apExcel.SheetsInNewWorkbook[0] := 1;
apExcel.Visible[0] := True;
Wk := apExcel.ActiveSheet as _Worksheet;
with Wk do begin
with Range[ 'A13', 'A13' ].Validation do begin
Delete;
Add(xlValidateCustom, xlValidAlertStop, null, '=GELIJK(REST(((DEEL(A16;1;1)*9)+(DEEL(A16;2;1)* +(DEEL(A16;3;1)*7)+(DEEL(A16;4;1)*6)+(DEEL(A16;5;1)*5)+(DEEL(A16;6;1)*4)+(DEEL(A16;7;1)*3)+(DEEL(A16;8;1)*2));11);DEEL(A16;9;1))', '');
IgnoreBlank := True;
InCellDropDown := True;
ErrorTitle := '9test';
ErrorMessage := 'message';
ShowInput := True;
ShowError := True;
end;
end;
apExcel.Disconnect;
end;
When I try this code from Delphi (Excel version is Dutch) I get an error: 'OLE error 800A03EC'.
Does someone know what the problem is?
(N.B. I want to validate a Sofinumber)
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|