|
こんにちは。
今一良く解っていないので突っ込まないで下さい。
特に
Mst2 = Mid(Mst, 1, Len(Mst) - 2) ← 何で-2なの?って。
'VBE → ツール → 参照設定
'Microsoft Scripting Runtime にチェック。
Sub fffgy()
Dim Fso As New Scripting.FileSystemObject
Dim Txs As Scripting.TextStream
Dim OPfl As String, Mst As String, Mst2 As String
OPfl = Application.GetOpenFilename("CSVFile (*.csv), *.csv")
If OPfl = "False" Then
End
End If
Set Txs = Fso.OpenTextFile(OPfl, ForReading)
Mst = Txs.ReadAll
Txs.Close
If Right(Mst, 1) = vbCr Or Right(Mst, 1) = vbLf Or Right(Mst, 1) = vbCrLf Then
Mst2 = Mid(Mst, 1, Len(Mst) - 2)
Set Txs = Fso.OpenTextFile(OPfl, ForWriting)
Txs.Write Mst2
Txs.Close
End If
Set Txs = Nothing
End Sub
|
|