Greetings,
With Access 2007 on Windows XP, VBA is being over helpful it clearing leading white space from lines it reads from a text file. Basically I have the following code, only in a multi-method class file, so I am copying / pasting into an inline rendition here:
I stepped through the FileRead function, and the value in the strThisLine has the leading white space stripped. Whitespace formatting is critical for data understandability!
Is there a way to instruct VBA not to be "so helpful"?
With Access 2007 on Windows XP, VBA is being over helpful it clearing leading white space from lines it reads from a text file. Basically I have the following code, only in a multi-method class file, so I am copying / pasting into an inline rendition here:
Code:
'Obtain a FileNumber for this class instance
FileNumber = FreeFile
Open FileName For Input As FileNumber
'Make sure the read buffer is empty to start with
strFileReadBuffer = ""
'Read the entire file into memory
Do While Not EOF(FileNumber)
Input #FileNumber, strThisLine
'Append this new data to the previos data, and append a CR/LF
strFileReadBuffer = strFileReadBuffer & strThisLine & vbCrLf
Loop
Close #FileNumber
Is there a way to instruct VBA not to be "so helpful"?
Last edited: