Cách viết Function VBA EXCEL tự động click.

Liên hệ QC
Tôi tuân thủ nội quy khi đăng bài

Tunghocexcel

Thành viên mới
Tham gia
13/4/23
Bài viết
4
Được thích
0
Em chào mọi người ạ, em có một folder hình trong máy tính tầm mấy chục ngàn hình, em có một file tên hình, ngày tháng năm, và hyperlink ạ. Thì có một số hình bị miss không có trong folder nên khi click vào hyperlink trong file excel thì nó báo lỗi là "cannot open specified file"
, cho em hỏi cách mình viết một VBA Function để auto click vào một cái hyperlink ở trong Cell và đếm số Hyperlink bị lỗi ạ. Em cảm ơn rất nhiều. File mẫu đây ạ
 

File đính kèm

  • Clikingfile.xlsx
    9.9 KB · Đọc: 5
PHP:
Function isFileExists(ByVal strPathFile As String) As Boolean
    'Returns True if file exists, else returns False
    If VBA.Len(strPathFile) = 0 Then isFileExists = False: Exit Function
    Static fso As Object
    If fso Is Nothing Then Set fso = CreateObject("Scripting.FileSystemObject")
    isFileExists = fso.FileExists(strPathFile)
End Function
 
PHP:
Function isFileExists(ByVal strPathFile As String) As Boolean
    'Returns True if file exists, else returns False
    If VBA.Len(strPathFile) = 0 Then isFileExists = False: Exit Function
    Static fso As Object
    If fso Is Nothing Then Set fso = CreateObject("Scripting.FileSystemObject")
    isFileExists = fso.FileExists(strPathFile)
End Function
Cảm ơn bạn rất nhiều <3
 
Web KT
Back
Top Bottom