'C 드라이브의 시리얼을 확인해서 틀리면 파일을 닫습니다..
Sub Auto_Open()
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.GetDrive("C:\").SerialNumber = "5736354" Then
Else
ThisWorkbook.Close
' Application.Quit
End If
End Sub
'시리얼을 알아내려면 다음 코드를 실행
Sub GetSerial()
Dim objFSO As Object
Set objFSO = CreateObject("Scripting.FileSystemObject")
MsgBox objFSO.GetDrive("C:\").SerialNumber
End Sub
'엑셀VBA' 카테고리의 다른 글
find함수에서 lookin:=xlformulas와 xlvaues의 차이점 (0) | 2012.12.28 |
---|---|
Do while ~ Loop 구문 응용 : 한 셀의 내용을 다음 4개 열에 복사 (0) | 2011.12.09 |
엑셀 자동 하이퍼링크 만들기(매크로) (0) | 2011.09.03 |
vlookup함수 사용 시 중복값 나타내기 (0) | 2011.07.08 |
매크로 셀이동 (0) | 2011.06.14 |