Share via


Workbook.Password Property (Excel)

Returns or sets the password that must be supplied to open the specified workbook. Read/write String.

Syntax

.Password

A variable that represents a Workbook object.

Remarks

대문자와 소문자, 숫자 및 기호로 구성된 강력한 암호를 사용하십시오. 이러한 요소가 혼합되어 있지 않은 암호가 취약한 암호입니다. 예를 들면 강력한 암호는 Y6dh!et5이고 취약한 암호는 House27입니다. 암호 길이는 8자 이상이어야 하고, 14자 이상의 암호라면 더 좋습니다. 자세한 내용은 Help protect your personal information with strong passwords를 참조하십시오. 암호를 기억해 두는 것은 매우 중요합니다. 암호를 잊은 경우 Microsoft에서 해당 암호를 검색할 수 없습니다. 암호는 기록해서 해당 정보와 상관없는 안전한 장소에 보관해야 정보를 더욱 안전하게 보호할 수 있습니다.

Example

In this example, Microsoft Excel opens a workbook named Password.xls, sets a password for it, and then closes the workbook. This example assumes a file named "Password.xls" exists on the C:\ drive.

Sub UsePassword() 
 
 Dim wkbOne As Workbook 
 
 Set wkbOne = Application.Workbooks.Open("C:\Password.xls") 
 
 wkbOne.Password = InputBox ("Enter Password") 
 wkbOne.Close 
 
End Sub

참고 항목

개념

Workbook Object

Workbook Object Members