1

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
            
Kostas K.
  • 8,293
  • 2
  • 22
  • 28
  • See this: https://stackoverflow.com/questions/5506912/how-should-i-make-my-vba-code-compatible-with-64-bit-windows – Kostas K. Mar 07 '22 at 14:52
  • Does this answer your question? [How should I make my VBA code compatible with 64-bit Windows?](https://stackoverflow.com/questions/5506912/how-should-i-make-my-vba-code-compatible-with-64-bit-windows) – HackSlash Mar 07 '22 at 16:21

0 Answers0