1. 有2個excel book1 & book2 ,開了book1 用vba開book2, 如果test
if book2開啟了 then end
end if
2. 如何做當off excel時 a1會自動=1?
請大大門幫幫忙.作者: et5323 時間: 2010-9-24 18:31
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作者: basarasy 時間: 2010-9-24 19:34