Search notes:

VBA statement: write#

write# is designed to generate machine-readable output that are later consumed with input#.
Therefore, strings being written with write# are enclosed in apostrophes. In order for VBA not to write the apostrophes, print# should be used.
write# also automatically adds a line break.
option explicit

sub main() ' {

    dim fileName as string
    fileName = environ$("temp") & "\VBA-print-test.txt"

    dim f as integer
    f = freeFile()

    open fileName for output as #f

    write# f, "Line one"
    write# f, "Line two"
    write# f, "Line three"

    close f

    debug.print("Check " & fileName)

end sub ' }
Github repository about-VBA, path: /language/statements/write/test.bas
The written file then looks as follows:
"Line one"
"Line two"
"Line three"

See also

VBA statements

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1758200929, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/VBA/language/statements/write/index(73): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78