Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
[vba/excel] テキストファイルにデータを書き出す
Sub OutputToTextFile()
Const FILE_NAME = "\Output.txt"
Dim FSO As Object
Dim TS As Object
Dim PathGetter As OMSGetter
Dim dicPath As Object
Dim path As Variant
Dim arrTmp As Variant
Dim sheetName As Variant
Dim strREC As String ' 書き出すレコード内容
Set FSO = CreateObject("Scripting.FileSystemObject")
Set TS = FSO.CreateTextFile( _
Filename:=ThisWorkbook.path & FILE_NAME, _
strREC = "サンプルテキスト"
TS.WriteLine strREC
Set TS = Nothing
Set FSO = Nothing
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.