- ©«¤l
- 4901
- ¥DÃD
- 44
- ºëµØ
- 24
- ¿n¤À
- 4916
- ÂI¦W
- 249
- §@·~¨t²Î
- Windows 7
- ³nÅ骩¥»
- Office 20xx
- ¾\ŪÅv
- 150
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥x¥_
- µù¥U®É¶¡
- 2010-4-30
- ³Ì«áµn¿ý
- 2024-11-17
|
¦^´_ 7# jsleee
#3ªºµ{§Ç´N¯à¸Ñ°£Âê©w- Sub ¶}±ÒÀÉ®×()
- Dim CurrentPath As String 'Àx¦s¥Ø«eÀɮץؿý
- Dim OpenFN As String 'Ū¨ú¨ìªºÀɮצWºÙ
- Dim FNExt As String 'ÀÉ®×°ÆÀɦW
- Dim MyBook As Workbook
- FN = ActiveWorkbook.Name
- CurrentPath = Range("B1") '¦pªG¦³³]©w¥H³]©w¬°¥D
- FNExt = Range("b2") '¬d¸ßÀÉ®×Ãþ«¬
- If Trim(CurrentPath) = "" Then
- CurrentPath = Excel.ActiveWorkbook.Path
- End If
-
- n = 0
- Sheets("trans").Cells.Delete '±N¤§«eªºµ²ªG²M°£
- If Right(CurrentPath, 1) = "\" Then
- OpenFN = Dir(CurrentPath & FNExt, vbDirectory)
- OpenFNTime = CurrentPath
- Else
- OpenFN = Dir(CurrentPath & "\" & FNExt, vbDirectory)
- OpenFNTime = CurrentPath & "\"
- End If
-
- While OpenFN <> ""
- If OpenFN <> ActiveWorkbook.Name Then '³oÓÀɮפ£nÅã¥Ü
- If OpenFN <> "." And OpenFN <> ".." Then
- n = n + 1
- fs = OpenFNTime & OpenFN
- Sheets("trans").Cells(n, 7).Value = fs
- Workbooks.Open(Filename:=OpenFNTime & OpenFN _
- , Password:="msign").RunAutoMacros Which:=xlAutoOpen
- Set MyBook = ActiveWorkbook
- UnprotectVBProj "password", MyBook '½Ð¦Û¦æקï±K½X
- End If
- End If
- OpenFN = Dir() 'Ū¨ú¤U¤@ÓÀÉ®×
- Wend
-
- Workbooks(FN).Close savechanges:=False
- End Sub
- Sub UnprotectVBProj(ByVal Pwd As String, wb As Workbook)
- Dim vbProj As Object
- Set vbProj = wb.VBProject
- If vbProj.Protection <> 1 Then Exit Sub ' already unprotected
- Set Application.VBE.ActiveVBProject = vbProj
- SendKeys Pwd & "~~"
- Application.VBE.CommandBars(1).FindControl(ID:=2578, recursive:=True).Execute
- End Sub
½Æ»s¥N½X |
|