Option Explicit
Sub TestMe()
Dim fs As FileSystemObject
Dim ts As TextStream
Set fs = New FileSystemObject
Set ts = fs.CreateTextFile("C:\tmp\file.txt", True)
ts.WriteLine "Header1, Header2"
ts.WriteLine "1," & CStr(DateTime.Now)
ts.Close
Set ts = Nothing
Set fs = Nothing
End Sub
Saturday, August 31, 2013
VBA: Using FileSystemObject to create a file
Sample code to create a file in VBA using FileSystemObject which is part of Microsoft Scripting Runtime. See this link on how to reference MSR.
Subscribe to:
Post Comments (Atom)
Install Winget on Windows 2022 or Windows 10 LSTC
Install Winget on Windows 2022 or Windows 10 LTSC Install Pre-reqs Install Microsoft.UI.Xaml/2.8.6 Navigate to https://www.nuget.org/pa...
-
Installing MonoDevelop in OpenSUSE 12.2 from its repository was very easy. When running it for the first time though I got the message: Th...
-
Tried to update my Ubuntu host today and it did pickup that new version of VirtualBox is available (4.1.8). All other packages installed pro...
-
This is quick start guide how to run ssh server on QNX. Tested on QNX 6.5 (650SP1-VM.tar). # ssh-keygen -t dsa -b 1024 -f /etc/ssh/ssh...
No comments:
Post a Comment