thutran0801
Thành viên chính thức


- Tham gia
- 19/8/16
- Bài viết
- 61
- Được thích
- 1
Chào mọi người, mình có đoạn code mở file như này có cách nào để báo lỗi khi không tìm thấy file hay đường dẫn bị sai ko? Cám ơn mọi người!!
Dim OutW As Workbook, InW As Workbook, OutP, InP As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
OutP = Cells(2, 2): InP = Cells(1, 2)
Set OutW = Workbooks.Open(OutP)
Set InW = Workbooks.Open(InP)
Dim OutW As Workbook, InW As Workbook, OutP, InP As String
Application.ScreenUpdating = False
Application.DisplayAlerts = False
OutP = Cells(2, 2): InP = Cells(1, 2)
Set OutW = Workbooks.Open(OutP)
Set InW = Workbooks.Open(InP)