0

In VBA, what do the different modes in the Open statement do and how do I use them?

As far as I understand:

  • Output: Write to file, overwrite any existing file
  • Append: Appends to an existing file
  • Input: Read from file (needs to read a file sequentially)
  • Random: Read/Write to/from a file (non-sequential, needs fixed data length)
  • Binary: For binary files

Two questions here:

  • Does it mean all except "Binary" relate only to Unicode files?
  • What would be a simple example for "Random" usage including the reading/writing part (trying to get a grasp for the last hour or so)
Albin
  • 1,000
  • 1
  • 11
  • 33
  • 1
    1) No, VBA [does not](https://stackoverflow.com/a/23980044/11683) natively work with Unicode files in principle, and 2) This is for when you have a database in a text file, with each record having the same length, people have really stopped doing that in the last couple of decades. – GSerg Jun 24 '23 at 17:37

0 Answers0