Table of contents
TOC
Collapse the table of content
Expand the table of content

Bad file mode (Error 54)

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

Statements used in manipulating file contents must be appropriate to the mode in which the file was opened. This error has the following causes and solutions:

  • A Put or Get statement is specifying a sequential file. Put and Get can only refer to files opened for Random or Binary access.

  • A Print # statement specifies a file opened for an access mode other than Output or Append. Use a different statement to place data in the file or reopen the file in an appropriate mode.

  • An Input # statement specifies a file opened for an access mode other than Input. Use a different statement to place data in the file or reopen the file in Input mode.

  • You attempted to write to a read-only file. Change the read/write status of the file or don't try to write to it.

For additional information, select the item in question and press F1 (in Windows) or HELP (on the Macintosh).

© 2018 Microsoft