Skip to main content

AccessTr.neT


Excel Dosyası Oluşturma

Excel Dosyası Oluşturma

Çözüldü #7
Haklısınız sanırım tam anlatamadım. Aslında devamına gerek yok ama ben size yine de kodun bir bölümünü göndereyim

-------------------------------------------------------------------

Dim DTB As DAO.Database
Dim RST1 As DAO.Recordset
Dim objExcel As Object
Dim objWorkbook As Object
Dim KaySayRST1, i As Integer

Set DTB = CurrentDb
Set RST1 = DTB.OpenRecordset("Policeler_GunlukUretimTakibi_Filtre_TMP")
Set objExcel = CreateObject("EXCEL.APPLICATION")
objExcel.Visible = True

Bu kısımda Excel dosyasını açmadan önce bir dosya oluşturmam gerekiyor. Alttaki dosya ismi kafanızı karıştırmasın.

Set objWorkbook = objExcel.Workbooks.Open("C:\test.xls")

If Not RST1.EOF Then RST1.MoveLast
KaySayRST1 = RST1.RecordCount
If Not RST1.EOF Then RST1.MoveFirst

objExcel.Cells(2, 2).Value = "Tür"
objExcel.Cells(2, 3).Value = "Şirket"
objExcel.Cells(2, 4).Value = "Üst Acente"
objExcel.Cells(2, 5).Value = "Tali"
objExcel.Cells(2, 6).Value = "Tanzim"
objExcel.Cells(2, 7).Value = "Başlama"
objExcel.Cells(2, 8).Value = "Poliçe No"
objExcel.Cells(2, 9).Value = "Sigortalı"
objExcel.Cells(2, 10).Value = "Brüt"
objExcel.Cells(2, 11).Value = "Onaylayan"

For i = 1 To KaySayRST1
If RST1!Kullanici = CurrentUser() Then
objExcel.Cells(i + 2, 2).Value = RST1!PoliceTur
objExcel.Cells(i + 2, 3).Value = RST1!PoliceSirket
objExcel.Cells(i + 2, 4).Value = RST1!UstAcente
objExcel.Cells(i + 2, 5).Value = RST1!Unvani
objExcel.Cells(i + 2, 6).Value = RST1!TanzimTarihi
objExcel.Cells(i + 2, 7).Value = RST1!BaslamaTarihi
objExcel.Cells(i + 2, 8).Value = RST1!PoliceNo
objExcel.Cells(i + 2, 9).Value = RST1!Sigortali_
objExcel.Cells(i + 2, 10).Value = RST1!BrutPrim
objExcel.Cells(i + 2, 11).Value = RST1!PersonelAdiSoyadi
End If
RST1.MoveNext
Next
Cevapla

Bir hesap oluşturun veya yorum yapmak için giriş yapın

Yorum yapmak için üye olmanız gerekiyor

ya da

Bu Konudaki Yorumlar
Excel Dosyası Oluşturma - Yazar: siberonik - 11/08/2009, 14:16
Cvp: Excel Dosyası Oluşturma - Yazar: Bilgisayarcı - 11/08/2009, 14:28
Cvp: Excel Dosyası Oluşturma - Yazar: siberonik - 11/08/2009, 14:38
Cvp: Excel Dosyası Oluşturma - Yazar: Bilgisayarcı - 11/08/2009, 14:40
Cvp: Excel Dosyası Oluşturma - Yazar: siberonik - 11/08/2009, 14:49
Cvp: Excel Dosyası Oluşturma - Yazar: Bilgisayarcı - 11/08/2009, 14:53
Cvp: Excel Dosyası Oluşturma - Yazar: siberonik - 11/08/2009, 15:18
Cvp: Excel Dosyası Oluşturma - Yazar: Bilgisayarcı - 11/08/2009, 15:36
Cvp: Excel Dosyası Oluşturma - Yazar: assenucler - 11/08/2009, 17:11
Cvp: Excel Dosyası Oluşturma - Yazar: Bilgisayarcı - 11/08/2009, 17:18
Cvp: Excel Dosyası Oluşturma - Yazar: assenucler - 11/08/2009, 17:22
Cvp: Excel Dosyası Oluşturma - Yazar: siberonik - 12/08/2009, 09:18
Task