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

¦p¦ó§PÂ_Àɮ׬O§_¤w¸g¶}±Ò

¦p¦ó§PÂ_Àɮ׬O§_¤w¸g¶}±Ò

½Ð°Ý¦p¦ó¥h§PÂ_«ü©wÀɮ׬O§_¤w¶}±Ò

¦^´_ 1# enoch

µ½¥[¹B¥Î½×¾Â ¥k¤W¤è  "·j¯Á"  ¥\¯à

http://forum.twbts.com/viewthrea ... E%D7%2B%B6%7D%B1%D2[/url]

TOP

­YªG·Q¥ÎIF ±ø¥ó¥i¥H°µ¨ì¶Ü?
·íÀÉ®×book1¥¼¶}±Ò,  Windows("book1.xls").Activate ¥X²{¿ù»~ §@¬°§PÂ_±ø¥ó
À³¸ÓÂI¼g©O, ½Ð«ü±Ð

TOP

¦^´_ 3# enoch
  1. Sub ZZ()
  2. For Each WB In Workbooks
  3. If WB.Name = "Book1" Then
  4.   MsgBox "¤w¶}±Ò"        '¤w¶}±Ò­n§@¤°»ò
  5.   temp = 1
  6.   Exit For
  7. End If
  8. Next
  9. If temp <> 1 Then
  10.    MsgBox "¥¼¶}±Ò"       '¥¼¶}±Ò­n§@¤°»ò
  11. End If
  12. End Sub
½Æ»s¥N½X

TOP

¥»©«³Ì«á¥Ñ alexliou ©ó 2012-3-30 17:03 ½s¿è

¦^´_ 1# enoch

Set wBook = Workbooks("book1.xls")
If wBook Is Nothing Then
      BookNotOpen = True
Else
     BookNotOpen = False
End If
Alex

TOP

¥t¤@¸Ñ
  1. Option Explicit
  2. Sub Ex()
  3.     Dim w As Workbook
  4.     For Each w In Workbooks
  5.         If w.Name = "Book2.xls" Then MsgBox "Book2.xls ¤w¶}±Ò "
  6.         '©Î¬O¤U¦¡µ{¦¡½X
  7.         'If w.FullName = "d:\test\Book2.xls" Then MsgBox ""d:\test\Book2.xls ¤w¶}±Ò "
  8.     Next
  9. End Sub
½Æ»s¥N½X

TOP

        ÀR«ä¦Û¦b : ¦Y­W¤F­W¡B­WºÉ¤Ü¨Ó¡A¨ÉºÖ¤FºÖ¡BºÖºÉ´d¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD