mehmet07 Posted May 10, 2013 Share Posted May 10, 2013 Merhabalar, Excel'den verileri okumak istiyorum. AStream: TFileStream); var Excel: Variant; WorkSheet : Variant; s: string; begin try try Excel := CreateOleObject('Excel.Application'); Excel.Visible := False; Excel.Workbooks.Open(AStream.FileName); memo.Lines.Add('File loaded'); WorkSheet := Excel.Workbooks[1].WorkSheets[1]; s := WorkSheet.Cells[1, 1]; memo.Lines.Add(Format('[1,1]="%s"', [s])); except on E: Exception do memo.Lines.Add('Error in Excel: ' + E.Message); end; finally if not VarIsEmpty(Excel) then Excel.Quit; end; Bunun için yukarıdaki kod'u kullandım. Normalde sıkıntısız çalışıyor. Ama Dll olarak çalıştırınca Erişim engellendi, ProgID: "Excel.Application" Hatasını alıyorum. Excel'den verileri nasıl okuyabilirim acaba? 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.