ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] ½Ð°Ý¶}±Ò½Æ¥»

[µo°Ý] ½Ð°Ý¶}±Ò½Æ¥»

¦U¦ì¤j¤j,·Q½Ð±Ð

Workbooks.Open Filename:=name, ReadOnly:=True
¤W­±»yªk¬O°ßŪ¶}±ÒÀÉ®×
¦ý¬O¦pªG¹J¨ì­ì¥»´N¤w¸g¶}±Òªºª¬ºA¤U(ÀɦW¤@¼Ë),´N·|³y¦¨¥²»ÝÃö±¼ÂÂÀɤ~¯à¶}±Ò,
¨Ò¦p­ì¥»´N¦³¶}±Ò A.xls(ÀɦW¤@¼Ë,¸ô®|¤£¦P),
¦pªGµ{¦¡­n¦A¶}±Ò A.xls ´N·|³y¦¨¿ù»~(¦]¬°¬Û¦PÀɦW)

¦pªG·Qª½±µ±N A.xls ¶}±Ò¦¨¬°½Æ¥»(ÁקK¶}¬Û¦PÀɦW),»yªk¸Ó¦p¦ó­×§ï©O? ·PÁÂ!

¥»©«³Ì«á¥Ñ 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
  1. Sub nn()
  2.   Dim sFlName$, sNFlName$
  3.   Dim bNFind As Boolean
  4.   Dim vA
  5.   
  6.   sFlName = "D:\test.xls" ' ²Ä¤@­ÓÀɮתº§¹¾ã¸ô®|+ÀɦW
  7.   Workbooks.Open sFlName, , True ' ¶}±Ò²Ä¤@­ÓÀÉ®×
  8.   sFlName = Mid(sFlName, InStrRev(sFlName, "\") + 1)
  9.   bNFind = True
  10.   For Each vA In Workbooks
  11.     If vA.Name = sFlName Then bNFind = False ' §ä¨ì¦P¦WÀɮפw¶}±Ò
  12.   Next
  13.   sFlName = "C:\test.xls" ' ²Ä¤G­ÓÀɮתº§¹¾ã¸ô®|+ÀɦW
  14.   If bNFind Then
  15.     Workbooks.Open sFlName, , True ' ­Y¥¼µo²{¦P¦WÀɮ׳Q¶}±Ò«hª½±µ¶}ÀÉ
  16.   Else
  17.     If Dir(sFlName) <> "" Then ' ½T»{¤£¦P¸ô®|¤U²Ä¤G­Ó¦P¦WÀɮ׬O¦s¦bªº
  18.       vA = InStrRev(sFlName, "\")
  19.       sNFlName = Left(sFlName, vA) & "°Æ¥»-" & Mid(sFlName, vA + 1)
  20.       Name sFlName As sNFlName ' ¥²¶·¥ý§ó¦W¤~¯à¶}±Ò¸ÓÀÉ®×
  21.       Workbooks.Open sNFlName, , True ' ¶}±Ò²Ä¤G­ÓÀÉ®×
  22.     End If
  23.   End If
  24. End Sub
½Æ»s¥N½X

TOP

¦^´_ 2# luhpro

¤£¾å±o¬Oª©¥»ªº°ÝÃDÁÙ¬O¨ä¥L,°õ¦æ¹Lµ{·|µo¥Í¿ù»~.

¤£¹L,¸g¥Ñ¤j¤j±z»yªk¤º®eªº«üÂI,§ï¥ÎShell¤è¦¡§ó§ïÀɦW¦A¶}±Ò¤wOK
·PÁÂ!

TOP

        ÀR«ä¦Û¦b : ¦³Ä@©ñ¦b¤ß¸Ì¡A¨S¦³¨­Åé¤O¦æ¡A¥¿¦p¯Ñ¥Ð¤£¼½ºØ¡A¬Ò¬OªÅ¹L¦]½t¡C
ªð¦^¦Cªí ¤W¤@¥DÃD