18-08-2023, Saat: 16:58
Arkadaşlar Merhaba ; Delphi 7 Kullanıyorum. DBGRid1 deki veriyi Excel gönderiyorum, "Alış" ve "Satış" olarak. Satış da gönderirken sorun yok Excel e aktarıyor aynı DBGrid1 ve veriler "Alış" a göre bunu gönderdiğimde hata alıyorum hiçbir fark yokken neden bu hatayı alıyorum çözemedim yardımınıza ihtiyacım var.
---------------------------
Debugger Exception Notification
---------------------------
Project EMNTMENU.exe raised exception class EAccessViolation with message 'Access violation at address 004E6B0A in module 'EMNTMENU.exe'. Read of address 00000000'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------
ShowMessage('Excel başlatılamıyor.'); Exit;
end;
try
with NRapor1 do
begin
Row := 3; // başlangıç 3. satır
First;
While not Eof do
begin
for Col := 0 to DBGrid1.FieldCount - 1 do
begin
Sheet.Cells[Row, Col + 1].Value := DBGrid1.Fields[Col].Value; //////// Hata bu satır
if Col + 1 >= 4 then
begin
////////////////////////////////
if Form9.EMANETPRM.FieldByName('EPARAM_9').AsString='False' then
begin
Form9.DBCheckBox8.Checked:=False;
ExcelApp.ActiveSheet.Columns[25].Delete;
End;
////////////////////////////////
case DBGrid1.Fields[Col].DataType of
ftInteger, ftFloat:
begin
Sheet.Cells[Row, Col + 1].Value := DBGrid1.Fields[Col].AsFloat;
Sheet.Cells[Row, Col + 1].NumberFormat := '#,###0.0000';
end;
else
begin
Sheet.Cells[Row, Col + 1].Value := DBGrid1.Fields[Col].Value;
end;
end;
end;
end;
---------------------------
Debugger Exception Notification
---------------------------
Project EMNTMENU.exe raised exception class EAccessViolation with message 'Access violation at address 004E6B0A in module 'EMNTMENU.exe'. Read of address 00000000'. Process stopped. Use Step or Run to continue.
---------------------------
OK Help
---------------------------