Just remove all references to the dialog and replace LoadFromFile with hard coded file name. See below:
procedure frmMain_Button4_OnClick (Sender: TObject; var Cancel: boolean);
var
userVar, modeVar : String;
DateVar, TimeVar : Extended;
sl: TStringList;
arrStr: array of string;
i,c: integer;
begin
sl := TStringList.Create;
sl.LoadFromFile (ExtractFilePath(Application.Exename) + 'YourFile.csv');
c := sl.Count - 1;
for i := 0 to c do
begin
arrStr := SplitString(sl[i], ';');
// Nombre
if arrStr[0] <> '' then arrStr[0] := ''''+ ReplaceStr(arrStr[0], '''', '''''') + ''''
else arrStr[0] := 'NULL';
// 1er Apellido
if arrStr[1] <> '' then arrStr[1] := ''''+ ReplaceStr(arrStr[1], '''', '''''') + ''''
else arrStr[1] := 'NULL';
// 2do Apellido
if arrStr[2] <> '' then arrStr[2] := ''''+ ReplaceStr(arrStr[2], '''', '''''') + ''''
else arrStr[2] := 'NULL';
// CI
if arrStr[3] <> '' then arrStr[3] := ''''+ ReplaceStr(arrStr[3], '''', '''''') + ''''
else arrStr[3] := 'NULL';
modeVar := 'Importado';
userVar := inttostr(frmLogin.cbLogin.dbItemID);
DateVar := Now;
TimeVar := Time;
SQLExecute ('INSERT INTO student (firstname, lastname, surname, ci, pestado, pparticular, mestado, mparticular, ujc, cdr, pcc, feu, fmc) VALUES ('+ arrStr[0] +','+ arrStr[1] +','+ arrStr[2] +','+ arrStr[3]+', 0, 0, 0, 0, 0, 0, 0, 0, 0);');
SQLExecute('INSERT INTO registro'+
'(dateadded, timeadded, firstname, lastname, surname, ci, mode, id_users) '+
'VALUES("'+DateToStr(DateVar)+'","'+TimeToStr(TimeVar)+'",'+ arrStr[0] +','+ arrStr[1] +','+ arrStr[2] +','+ arrStr[3] +',"'+modeVar+'","'+userVar+'")');
frmMain.Label22.Caption := IntToStr(i+1) + ' of ' + IntToStr(c+1);
Application.ProcessMessages;
end;
UpdateDatabase('student');
UpdateDatabase('registro');
sl.Free;
frmMain.TableGrid1.dbUpdate;
frmMain.TableGrid2.dbUpdate;
frmStaticsUser.TableGrid2.dbUpdate;
end;