텍스트파일 생성_저장(Open,Write,Print)
작성자 정보
- 모아 작성
- 작성일
컨텐츠 정보
- 10 조회
- 0 추천
- 0 비추천
- 목록
본문
Sub SAM파일생성()
'
' Text파일(SAM파일) 생성
'
Open "c:\문서\TestFile.txt" For Output As #1 ' Open file for output.
Write #1, "Hello World", 234 ' Write comma-delimited data.
Print #1, "Hello World"; 234 ' Print in two print zones.
Write #1, ' Write blank line.
Dim MyBool, MyDate, MyNull, MyError
' Assign Boolean, Date, Null, and Error values.
MyBool = False: MyDate = #2/12/1969#: MyNull = Null
MyError = CVErr(32767)
' Boolean data is written as #TRUE# or #FALSE#. Date literals are
' written in universal date format, for example, #1994-07-13#
'represents July 13, 1994. Null data is written as #NULL#.
' Error data is written as #ERROR errorcode#.
Print #1, MyBool; " is a Boolean value"
Print #1, MyDate; " is a date"
Print #1, MyNull; " is a null value"
Print #1, MyError; " is an error value"
Close #1 ' Close file.
'생성된 파일 내용
' "Hello World",234
' Hello World 234
'
' False is a Boolean value
' 1969-02-12 is a date
' Null is a null value
' 오류 32767 is an error value
End Sub
[출처] 엑셀매크로(VBA) - 예제 모음|작성자 천칭
|
포인트 선물 선물명단 선물하기
최소 5P ~ 최대 100000000P 까지 가능합니다.
로그인 후 선물하실 수 있습니다.
선물 받은 내용이 없습니다.
관련자료

-
등록일 05:56
-
등록일 05:56
-
등록일 05:56
-
등록일 05:55