|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
我有一个用来打开有密码文件的宏,如果所有文件是同一密码,打开很方便,但我现在文件密码各不相同,但密码是文件名,中文英文的都有,请问这种情况下,如何写Openpassword 宏语言?多谢!!
Sub Compilation()
Dim Temp As String
Dim Ligne As Long
Temp = Dir(ActiveWorkbook.Path & "\*.xlsx")
Range("dz1") = Temp
Openpassword = Range("ea1")
Application.DisplayAlerts = False
Do While Temp <> ""
If Temp <> "RecapPA.xlsm" Then
Workbooks.Open ActiveWorkbook.Path & "\" & Temp, Password:=Openpassword
Workbooks(Temp).Sheets(1).Activate
'ActiveSheet.Unprotect Password:="123"
Ligne = Sheets(1).Range("A65536").End(xlUp).Row + 1
Rows("24:" & CStr(Ligne)).Select
Selection.Copy
|
|