- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 13
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-10-25
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2014-11-18 23:24 ½s¿è
¦U¦ì¤j¤j,·Q½Ð±Ð
Workbooks.Open Filename:=name, ReadOnly:=True
¤W±»yªk¬O°ßŪ¶}±ÒÀÉ®×
¦ý¬O¦pªG¹J ...
jackdream µoªí©ó 2014-11-17 10:59 - Sub nn()
- Dim sFlName$, sNFlName$
- Dim bNFind As Boolean
- Dim vA
-
- sFlName = "D:\test.xls" ' ²Ä¤@ÓÀɮתº§¹¾ã¸ô®|+ÀɦW
- Workbooks.Open sFlName, , True ' ¶}±Ò²Ä¤@ÓÀÉ®×
- sFlName = Mid(sFlName, InStrRev(sFlName, "\") + 1)
- bNFind = True
- For Each vA In Workbooks
- If vA.Name = sFlName Then bNFind = False ' §ä¨ì¦P¦WÀɮפw¶}±Ò
- Next
- sFlName = "C:\test.xls" ' ²Ä¤GÓÀɮתº§¹¾ã¸ô®|+ÀɦW
- If bNFind Then
- Workbooks.Open sFlName, , True ' Y¥¼µo²{¦P¦WÀɮ׳Q¶}±Ò«hª½±µ¶}ÀÉ
- Else
- If Dir(sFlName) <> "" Then ' ½T»{¤£¦P¸ô®|¤U²Ä¤GÓ¦P¦WÀɮ׬O¦s¦bªº
- vA = InStrRev(sFlName, "\")
- sNFlName = Left(sFlName, vA) & "°Æ¥»-" & Mid(sFlName, vA + 1)
- Name sFlName As sNFlName ' ¥²¶·¥ý§ó¦W¤~¯à¶}±Ò¸ÓÀÉ®×
- Workbooks.Open sNFlName, , True ' ¶}±Ò²Ä¤GÓÀÉ®×
- End If
- End If
- End Sub
½Æ»s¥N½X |
|