11/03/2020, 15:06
iyi günler fonsiyon adımları nasıl oluyor
Private Function writeExcel() As Boolean
On Error GoTo Err_hata
Dim result As Boolean
result = 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, ".")
rq_Exit:
Set xlWS = Nothing
xlWB.Close acSaveYes
Set xlWB = Nothing
xlApp.Quit
Set xlApp = Nothing
result = True
Exit_kod:
writeExcel = result
Exit Function
Err_hata:
result = False
MsgBox Err.Description
Resume Exit_kod
End Function