Copy this into a module:
Declare Function apiCopyFile Lib "kernel32" Alias "CopyFileA" _
(ByVal lpExistingFileName As String, _
ByVal lpNewFileName As String, _
ByVal bFailIfExists As Long) As Long
In your form call:
Dim sFilePath as string
dim sNewFile as string
sfilepath = 'path and file name of .txt file
snewFile = Replace(sfilepath,"txt", "csv"
apiCopyFile sfilepath ,sNewFile, False
'delete file from current directory
Kill sfilepath
If you know the spacing definition. You can open the file,
write the values in to variables, format them how ever you need to, and write the output to your new .cvs file.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.