Dim xlApp As Excel.Application
Dim objWkb As Workbook
Dim rs As DAO.Recordset
Dim xlSh As Worksheet
Set xlApp = New Excel.Application
xlApp.Visible = True
Set objWkb = xlApp.Workbooks.Add
Set rs = CurrentDb.OpenRecordset("Tablo1")
If Not (rs.EOF And rs.BOF) Then
rs.MoveFirst
Do Until rs.EOF = True
Set xlSh = objWkb.Sheets.Add
xlSh.Name = rs!adi & " " & rs!soyada
xlSh.Range("B13") = rs!adi
xlSh.Range("B14") = rs!soyada
rs.MoveNext
Loop
End If
For Each xlSh In objWkb.Worksheets
If InStr(1, xlSh.Name, "Sayfa") = 1 Then
objWkb.Worksheets(xlSh.Name).Delete
End If
Next xlSh
Butonun tıklandığında olayındaki kodu aşağıdaki ile değiştirerek deneyiniz.