'I'm trying to convert this PtrSafe to 64 bit and I've added the Win64 and LongPtr but it still is highlighted in red. Any suggestions?

I'm trying to convert this PtrSafe to 64 bit and I've added the Win64 and LongPtr but it still is highlighted in red. Any suggestions?

Option Compare Database
Option Explicit

Public lngRefNum As LongPtr
Public blnSetupCK As Boolean

#If Win64 Then

    Private Declare PtrSafe Function ShellExecute Lib "shell32.dll" _
            Alias "ShellExecuteA" _
           (ByVal hWnd As LongPtr, _
            ByVal lpOperation As String, _
            ByVal lpFile As String, _
            ByVal lpParameters As String, _
            ByVal lpDirectory As String, _
            ByVal nShowCmd As LongPtr) As Long
            
#Else
        Private Declare Function ShellExecute Lib "shell32.dll" _
            Alias "ShellExecuteA" _
           (ByVal hWnd As LongPtr, _
            ByVal lpOperation As String, _
            ByVal lpFile As String, _
            ByVal lpParameters As String, _
            ByVal lpDirectory As String, _
            ByVal nShowCmd As LongPtr) As Long
            
vba


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source