Private Function writeExcel() As Boolean
On Error GoTo Err_hata
writeExcel = False
Dim xlApp As Excel.Application
Dim xlWB As Excel.Workbook
Dim xlWS As Excel.Worksheet
Dim acRng As Variant
Dim xlRow As Integer
Dim xlColumn As Integer
Set xlApp = New Excel.Application
Set xlWB = xlApp.Workbooks.Open(targetFullName)
Set xlWS = xlWB.Worksheets("Sayfa2")
xlWS.Range("G17").Formula = Nz(aktif_isim, ".")
xlWS.Range("R17").Formula = Nz(aktif_sicil, ".")
xlWS.Range("G18").Formula = Nz(aktif_tc, ".")
Set xlWS = Nothing
xlWB.Close acSaveYes
Set xlWB = Nothing
xlApp.Quit
Set xlApp = Nothing
writeExcel = true
Exit Function
Err_hata:
Set xlWS = Nothing
xlWB.Close False
Set xlWB = Nothing
writeExcel = False
xlApp.Quit
Set xlApp = Nothing
End Function
Telefondan alttaki gibi düzenleyebildim.