19-11-2011, 10:50 AM
29-06-2012, 01:39 PM
بارك الله فيكم على هذا المجهود الطيب
07-07-2012, 12:30 AM
بارك الله فيك
07-07-2012, 12:33 AM
كود :
var i,i2,i3:integer;
ExcelApp :Variant;
begin
try
ExcelApp:=CreateOleObject('Excel.Application');
abstable2.First;
i:=4;
i2:=1;
i3:=1;
Button3.Caption:=' Excel Open ';
ExcelApp.Workbooks.Add;
while not abstable2.eof do
begin
if i2=1 then
ExcelApp.Cells[i,1].Value:=1
else
ExcelApp.Cells[i,1].Value:=i2;
Button3.Caption:='Insetion :'+inttostr(i3);
ExcelApp.Cells[i,2].Value:=abstable2['matricule'];
ExcelApp.Cells[i,3].Value:=abstable2['nom'];
ExcelApp.Cells[i,4].Value:=abstable2['prenon'];
ExcelApp.Cells[i,5].Value:=abstable2['datedabsence'];
ExcelApp.Cells[i,6].Value:=abstable2['absence'];
abstable2.Next;
i:=i+1;
inc(i2);
inc(i3);
end;
Button3.Caption:='Lancer Excel';
ExcelApp.Visible:=True;
except
showmessage('Impossible de Excute Excel');
end;
end;16-06-2014, 08:19 AM
بارك اللله فيك أخي، ولكن عند محاولة التطبيق تظهر لي رسالة خطأ مكتوب فيها
[Avertissement] Unit1.pas(80): L'expression constante dépasse les limites de sous-étendueفما الحل أخي المبارك
[Avertissement] Unit1.pas(80): L'expression constante dépasse les limites de sous-étendueفما الحل أخي المبارك
10-02-2015, 09:32 AM
شكرا اخي شرح ولا اروع لكن عندي مشكلة وهي تتمثل في كيفية الحصول علي ExcelApplication
19-05-2015, 04:33 PM
بارك الله فيكم إخوتي و جزاكم الله كل خير
11-04-2018, 11:14 PM
سلام عليكم
بارك الله فيك
لاكن يوجد مشكلة في التاريخ
مثال 12/02/2018 عندما اقوم بتصدير البيانات الي exel يحول التاريخ الى 02/12/2018
من فظلك اريد المساعدة في حل هاذا المشكل
شكرا
بارك الله فيك
لاكن يوجد مشكلة في التاريخ
مثال 12/02/2018 عندما اقوم بتصدير البيانات الي exel يحول التاريخ الى 02/12/2018
من فظلك اريد المساعدة في حل هاذا المشكل
شكرا
19-08-2020, 07:27 AM
(13-04-2008, 02:12 AM)merouane كتب : [ -> ]عند التصدير (من DBGrid)
كود :[color=Blue]Try[/color] [COLOR=Black] Try ExcelApplication1.Visible[0]:=true; For i:=0 to DBGrid1.Columns.Count-1 do begin with Feuil.Range[A[i+1]+'1',A[i+1]+'1'] do begin Value[xlRangeValueDefault]:= DBGrid1.Columns.Items[i].Title.Caption; Font.Name:='times new roman'; Font.Size:=10; Font.Bold:=True; With Interior do begin ColorIndex := 15; Pattern := xlSolid; PatternColorIndex := xlAutomatic; End; With Borders do begin LineStyle := xlContinuous; Weight := xlThin; ColorIndex := xlAutomatic; End; End; End; j:=2; Table1.DisableControls; Table1.First; While not Table1.Eof do begin For i:= 1 To DBGrid1.Columns.Count Do begin s:=A[i]+inttostr(j); Feuil.Range[s,s].Value[xlRangeValueDefault] :=DBGrid1.Fields[i-1].AsString; end; Table1.Next; j:=j+1; end; Finally ExcelApplication1.Cells.Select; ExcelApplication1.Columns.AutoFit; ExcelApplication1.Range['A1','A1'].Select; End; [color=Blue]Except[/color] on E: Exception do MessageDlg(E.Message,mtError,[mbOK], E.HelpContext);[/COLOR] [color=Blue]End;[/color]
هذه الطريقة تشتغل معي بشكل جد رائع مع دلفي 7 ،
لكن بعد الانتقال إلى دلفي Sydeny واجهتني المشكلة التالية :
إقتباس :[dcc32 Erreur] E2064 La partie gauche n'est pas affectable
تحديدا في السطر التالي :
هل من توجيه بارك الله فيكم.كود :Value[xlRangeValueDefault]:= DBGrid1.Columns.Items[i].Title.Caption;
19-08-2020, 05:07 PM
حلت المشكلة ولله الحمد.
المشكلة كانت في حزمة office المفعلة.
في بادئ الأمر كنت مفعل حزمة Excel2000 .
و هي سبب المشكلة ،
قمت بإلغاء تفعيلها ، وفعلت بدلها حزمة ExcelXP.
المشكلة كانت في حزمة office المفعلة.
في بادئ الأمر كنت مفعل حزمة Excel2000 .
و هي سبب المشكلة ،
قمت بإلغاء تفعيلها ، وفعلت بدلها حزمة ExcelXP.