I'm trying to append a text in a file text but error 5 popups, here's my code
I referenced the module to Microsoft Scripting Runtime. I use Excel 2016.![]()
Option Explicit Sub Appentext() Const ForReading = 1, ForWriting = 2, ForAppending = 3 Dim fs, f Set fs = CreateObject("Scripting.FileSystemObject") Set f = fs.OpenTextFile(ActiveWorkbook.Path & "\pool1.txt", ForAppending, TristateUseDefault) f.Write "Hello world!" f.Close End Sub
I do not know what is happening,
Bookmarks