Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
15
Task/Write-entire-file/VBA/write-entire-file.vba
Normal file
15
Task/Write-entire-file/VBA/write-entire-file.vba
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
Option Explicit
|
||||
|
||||
Const strName As String = "MyFileText.txt"
|
||||
Const Text As String = "(Over)write a file so that it contains a string. " & vbCrLf & _
|
||||
"The reverse of Read entire file—for when you want to update or " & vbCrLf & _
|
||||
"create a file which you would read in its entirety all at once."
|
||||
|
||||
Sub Main()
|
||||
Dim Nb As Integer
|
||||
|
||||
Nb = FreeFile
|
||||
Open "C:\Users\" & Environ("username") & "\Desktop\" & strName For Output As #Nb
|
||||
Print #1, Text
|
||||
Close #Nb
|
||||
End Sub
|
||||
Loading…
Add table
Add a link
Reference in a new issue