Do you have the 1. before the first declaration?
DId you use conditional compiling by prefacing the If, Else and End If with #
Try #If VBA7 then
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi there,
Hope all is good.
My MS office 2016 was upgraded to x64 (from x32), after that I got the following error message when I open the excel file created before
Compile error: 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."
Previously my module code read:
Declare Function XXX Lib "shell32.dll" _
Alias "XXXA" (ByVal PPP As Long, ByVal QQQ As String) As Long
Declare Function YYY Lib "shell32.dll" _
Alias "YYYA" (lMYINFOR As MYINFOR) As Long
I have changed above codes to the following
Declare PtrSafe Function XXX Lib "shell32.dll" _
Alias "XXXA" (ByVal PPP As LongPtr, ByVal QQQ As String) As Long
Declare PtrSafe Function YYY Lib "shell32.dll" _
Alias "YYYA" (lMYINFOR As MYINFOR) As Long
Declare Function XXX Lib "shell32.dll" _
Alias "XXXA" (ByVal PPP As Long, ByVal QQQ As String) As Long
Declare Function YYY Lib "shell32.dll" _
Alias "YYYA" (lMYINFOR As MYINFOR) As Long
After I saved the file, the compile error was gone but the file constantly froze.
Can you please show me what else I missed in order to make this file (created in x32) work probably for both x32 and x64 Excel versions?
Many thanks,
July
Do you have the 1. before the first declaration?
DId you use conditional compiling by prefacing the If, Else and End If with #
Try #If VBA7 then