Link to home
Start Free TrialLog in
Avatar of dhsimmons_sl
dhsimmons_sl

asked on

Compile error using PrtSafe in VBA 6.0 with Conditional Compilation

Can any one help. I receive a compile error when adding PrtSafe to a Declare Function.

The code is:

' Declaration for the DeviceCapabilities function API call.
#If VBA7 Then
        Private Declare PtrSafe Function DeviceCapabilities Lib "winspool.drv" _
            Alias "DeviceCapabilitiesA" (ByVal lpsDeviceName As String, _
            ByVal lpPort As String, ByVal iIndex As Long, lpOutput As Any, _
            ByVal lpDevMode As Long) As LongLong
#Else
        Declare Function DeviceCapabilities Lib "winspool.drv" _
            Alias "DeviceCapabilitiesA" (ByVal lpsDeviceName As String, _
            ByVal lpPort As String, ByVal iIndex As Long, lpOutput As Any, _
            ByVal lpDevMode As Long) As Long
#End If

Please don't suggest removing the code. It is an inherited application and do not want to rewrite it.

Modules were created in Access 2007 with VBA 6.5 attempting to run with some users that have Office (Access) 2010 64-bit VBA 7.0.

Thank You
ASKER CERTIFIED SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial