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

2­Óvba°ÝÃD

2­Óvba°ÝÃD

1. ¦³2­Óexcel   book1 & book2 ,¶}¤Fbook1 ¥Îvba¶}book2, ¦pªGtest
if book2¶}±Ò¤F then  end
end if

2. ¦p¦ó°µ·íoff excel®É   a1·|¦Û°Ê=1?

½Ð¤j¤jªùÀ°À°¦£.
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

Function bWkOpen(sTargetWkName) As Boolean
    Dim xlWk As Workbook
    On Error Resume Next
    Err.Clear
    Set xlWk = Workbooks(sTargetWkName)
    If Err.Number = 0 Then
        bWkOpen = True
    Else
        bWkOpen = False
        Err.Clear
    End If
    Set xlWk = Nothing
End Function
Sub test()
    MsgBox bWkOpen("Book1.xls")
End Sub

TOP

[ª©¥DºÞ²z¯d¨¥]
  • Hsieh(2010-9-24 19:44): ¦Û¤vÀ³¸Ó¥h¤F¸Ñµ{¦¡»yªk¡A½×¾Â«D¥[¤u¼t

¦^´_ 2# et5323


    ÁÂÁ¤j¤j
¥i§_§ï¦¨ book1¥H¶}®É
msgbox ½ÐÃöbook1
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : «H¤ß¡B¼Ý¤O¡B«i®ð¤TªÌ¨ã³Æ¡A«h¤Ñ¤U¨S¦³°µ¤£¦¨ªº¨Æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD