alucard Posted January 17, 2017 Posted January 17, 2017 Excel' aktarım yapmak istiyorum. Herzaman kullandığım kodu kullanıyorum ama bu hatayı veriyor. Kullandığım kod: uses ComObj,ActiveX procedure TForm2.UniBitBtn21Click(Sender: TObject); var excel,Workbook,sheet: Variant; a,i:integer; begin excel:= CreateOleObject('Excel.Application'); Workbook:=EXCEL.WORKBOOKS.ADD; sheet := Workbook.WORKSHEETS[1] ; TRY for i := 1 to IBQEgitmAlanlar.FieldCount-1 do begin sheet.CELLS[1,i] := IBQEgitmAlanlar.Fields[i-1].FieldName ; IBQEgitmAlanlar.First; for a := 2 to IBQEgitmAlanlar.RecordCount+1 do begin sheet.CELLS[a,i] := IBQEgitmAlanlar.FieldByName(IBQEgitmAlanlar.Fields[i-1].FieldName).asstring ; //showmessage(dtTable.FieldByName(dtTable.Fields[1].FieldName).Value) ; IBQEgitmAlanlar.Next; end; end; EXCEL.VISIBLE := TRUE; Except ON E:EXCEPTION DO BEGIN ShowMessage(E.Message); CLOSE; END; END; //excel.close; end; Quote
mehmet07 Posted January 17, 2017 Posted January 17, 2017 Bu sekilde unigui icerisinde excel kullanamazsiniz. Masaustunde calisir ama unigui de kod is gormez. Forumda excel aktarimlari ile iligili ornekler mevcuttu. suan zamanim olmadigi icin bakamadim. Quote
alucard Posted January 17, 2017 Author Posted January 17, 2017 başka bir projede kullandım hocam çalışıyorda. ama bunda çalışmadı. neyi yanlış yaptığımıda bulamadım Quote
Hayri ASLAN Posted January 17, 2017 Posted January 17, 2017 Servermodule.AutoCoinitialize True mu? Quote
Administrators Farshad Mohajeri Posted January 17, 2017 Administrators Posted January 17, 2017 Bunun icin Excelin kurulu olmasi lazim. Ancak bu yontem genel olarak uygun degildir. Quote
iyarar Posted January 18, 2017 Posted January 18, 2017 TMS Flexcel kullanmanızı tavsiye ediyorum. sorunsuz çalışıyor Quote
alucard Posted January 20, 2017 Author Posted January 20, 2017 TMS Flexcel kullanmanızı tavsiye ediyorum. sorunsuz çalışıyor hocam bu component ücretli herhalde. ben ücretsiz bir şekilde çözüm yolu arıyorum. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.