alucard Posted January 17, 2017 Share 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 Link to comment Share on other sites More sharing options...
mehmet07 Posted January 17, 2017 Share 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 Link to comment Share on other sites More sharing options...
alucard Posted January 17, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
Hayri ASLAN Posted January 17, 2017 Share Posted January 17, 2017 Servermodule.AutoCoinitialize True mu? Quote Link to comment Share on other sites More sharing options...
alucard Posted January 17, 2017 Author Share Posted January 17, 2017 true hocam Quote Link to comment Share on other sites More sharing options...
alucard Posted January 17, 2017 Author Share Posted January 17, 2017 Kod boş bir projede çalışıyor. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted January 17, 2017 Administrators Share Posted January 17, 2017 Bunun icin Excelin kurulu olmasi lazim. Ancak bu yontem genel olarak uygun degildir. Quote Link to comment Share on other sites More sharing options...
iyarar Posted January 18, 2017 Share Posted January 18, 2017 TMS Flexcel kullanmanızı tavsiye ediyorum. sorunsuz çalışıyor Quote Link to comment Share on other sites More sharing options...
alucard Posted January 20, 2017 Author Share 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 Link to comment Share on other sites More sharing options...
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.