File Input/Output with VBA
- Last UpdatedJul 18, 2023
- 1 minute read
VBA supports full sequential and binary file Input/Output (I/O).
Files stored on disk, can contain text (ASCII) characters or binary (ones and zeros) digits. All VBA files that contain VBA code are stored as text files. However, you can use VBA to store and retrieve files in either format, using VBA file I/O functions and statements.
The File I/O functions predefined in VBA are:
ChDir, ChDrive, Close, CurDir, Dir, EOF, FileCopy, FileLen,
FreeFile, Get #, GetAttr, Input #, Kill, Line Input #, Loc, LOF,
MkDir, RmDir, Name, Open, Print #, Put, Seek, SetAttr, Write #.
For details of all predefined VBA functions, see VBA Function Reference.