Function joa_txt(joa_txt1 As String, Optional joa_txt2 As String, Optional joa_txt3 As String,numero as string)
On Error GoTo Err_Error
Dim joa_NA
joa_NA = FreeFile
sPath="Y:\"& numero &".txt"
Open sPath For Append As #joa_NA
Print #joa_NA, joa_txt1 ' escribe el 1er parametro en el archivo
If Not IsMissing(joa_txt2) Then Print #joa_NA, joa_txt2 ' escribe el 2du parametro en el archivo
If Not IsMissing(joa_txt3) Then Print #joa_NA, joa_txt3 ' escribe el 3er parametro en el archivo
Close #joa_NA
Exit_EtqiuetaError:
Exit Function
Err_Error:
MsgBox "Error Nº " & Err.Number & " programa: Contabilidad" & Chr(13) _
& Err.Description, vbCritical + vbOKOnly, "Aviso de Error"
Resume Exit_EtqiuetaError
End Function