Since migrating to Access 2010 a macro that we use to export contents of a table to a text file has been giving problems.
In a certain field when it is left empty instead of blanks it puts NUL --> this gives problems when that text file is read in SAP.
The problem is resolved if the text file is opened and then saved in notepad so i tried to do this in the macro.
The code to open the text file in notepad is easy and given below but so far i have not found a way to save and close the file automatically.
Is there a way do do this in vba ?
Thank you in advance for all help, Stefan.
Dim myFile As String
Dim Filename As String
Filename = Format(Date, "yyyymmdd") + "Sap.txt"
myFile = Shell("C:\WINDOWS\notepad.exe \\gentlmxlm\data5\KAS\Jeugddienst\" + Filename, vbNormalFocus)
In a certain field when it is left empty instead of blanks it puts NUL --> this gives problems when that text file is read in SAP.
The problem is resolved if the text file is opened and then saved in notepad so i tried to do this in the macro.
The code to open the text file in notepad is easy and given below but so far i have not found a way to save and close the file automatically.
Is there a way do do this in vba ?
Thank you in advance for all help, Stefan.
Dim myFile As String
Dim Filename As String
Filename = Format(Date, "yyyymmdd") + "Sap.txt"
myFile = Shell("C:\WINDOWS\notepad.exe \\gentlmxlm\data5\KAS\Jeugddienst\" + Filename, vbNormalFocus)