Skip to content

Instantly share code, notes, and snippets.

@DuongAQ
Created June 14, 2019 07:07
Show Gist options
  • Save DuongAQ/a2362ecbb788bf9803fb630a2ad35369 to your computer and use it in GitHub Desktop.
Save DuongAQ/a2362ecbb788bf9803fb630a2ad35369 to your computer and use it in GitHub Desktop.
Sub CheckIfFileOpen()
Dim fileName As String
fileName = "C:\Users\marks\Documents\......." 'Tên file kèm đường dẫn
'Gọi function kiểm tra file đóng hay mở
If IsFileOpen(fileName) = False Then
'Câu lệnh thực hiện khi file đang đóng
Else
'File đang mở hoặc lỗi khác
MsgBox fileName & " is already open."
End If
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment