ªð¦^¦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 : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD