I need to convert a TXT file with UNIX encoding for Windows, I found a solution in Vba, but I can’t insert it in the code, could you help me?
Code
Sub ConverterDeUnix()
'ahteixeira 2016 para MaximoAccess
Dim fOrigem$, fDestino$, Linha$
fOrigem = “C:\FEBRABAN\OI_UNIX.txt”
fDestino = “C:\FEBRABAN\OI_UNIX_Convertido.txt”
Open fOrigem For Input Access Read As #1
Line Input #1, Linha
If EOF(1) Then
Linha = Replace(Linha, vbLf, vbCrLf)
Close #1
Open fDestino For Output Access Write As #1
Print #1, Linha
Close #1
Else
Close #1
End If
End Sub
Hello Israel, @Yoichi is right, it is not possible to execute copied VBA code in an Invoke Code activity. The approach of the Invoke Code activity is different, that’s why you have all the error messages. You can find more information about Invoke Code Activity in the documentation.
Best regards
Stefan