VBA lỗi 64 bit giúp em với!!! lỗi Please review and update Declare statements and then mark them with the PtrSafe attribute

Mc2296

Thành viên mới
Tham gia ngày
25 Tháng tư 2021
Bài viết
1
Được thích
0
Điểm
1
Tuổi
22
em bị lỗi 64 bit khi nhận được file của một người gửi em. hiện lỗi The code in this project must be updated for use on 64-bit systems. Please review and update Declare statements and then mark them with the PtrSafe attribute. giúp em sửa với ạ. em sử dụng excel 16. e k biết gì nhiều về VBA.
 

File đính kèm

  • COPY THEO DANH SACH (1).xlsm
    49.9 KB · Đọc: 5

batman1

Thành viên gạo cội
Tham gia ngày
8 Tháng chín 2014
Bài viết
4,131
Được thích
6,571
Điểm
2,568
Thay
Mã:
Private Type SHFILEOPSTRUCT
    hwnd As Long
    wFunc As Long
    pFrom As String
    pTo As String
    fFlags As Integer
    fAborted As Long
    hNameMaps As Long
    sProgress As String
End Type
...
Private Declare Function MoveFile Lib "kernel32.dll" Alias "MoveFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Long
Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
bằng
Mã:
#If VBA7 Then
    Private Type SHFILEOPSTRUCT
            hwnd As LongPtr
            wFunc As Long
            pFrom As String
            pTo As String
            fFlags As Integer
            fAborted As Long
            hNameMaps As LongPtr
            sProgress As String
    End Type
#Else
    Private Type SHFILEOPSTRUCT
        hwnd As Long
        wFunc As Long
        pFrom As String
        pTo As String
        fFlags As Integer
        fAborted As Long
        hNameMaps As Long
        sProgress As String
    End Type
#End If
...
#If VBA7 Then
    Private Declare PtrSafe Function MoveFile Lib "kernel32" Alias "MoveFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Long
    Private Declare PtrSafe Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
#Else
    Private Declare Function MoveFile Lib "kernel32.dll" Alias "MoveFileA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String) As Long
    Private Declare Function SHFileOperation Lib "shell32.dll" Alias "SHFileOperationA" (lpFileOp As SHFILEOPSTRUCT) As Long
#End If
 
Top Bottom