Here is essentially the code I would write for what you're doing.
procedure AddCustomer;
var
CustomerCSV;
begin
CustomerCSV := DDT.CSVDriver('C:\MyPath\MyCustomers.csv');
LogIntoApp;
while not CustomerCSV.EOF do begin
EnterCustomerInformation(CustomerCSV); //procedure would then use .Value[<ColumnName>] to populate the screen
CustomerCSV.Next;
end;
DDT.CloseDriver(CustomerCSV.Name);
end;
So, some questions for you:
1) You're using DDT.CurrentDriver. How are you assigning the driver so that DDT.CurrentDriver works?
2) You mention using the CSVDriver but you're talking about an Excel Spreadsheet. When you create your driver, are you pointing to the CSV file or are you pointing to the xls file?
It might be helpful to see the actual code you're working with if possible.