BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Validating data in excel

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation
View previous topic :: View next topic  
Author Message
bakker
Guest





PostPosted: Thu Sep 16, 2004 7:31 am    Post subject: Validating data in excel Reply with quote




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)*Cool+(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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi OLE Automation All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.