troubleshooting Question

Compile error using PrtSafe in VBA 6.0 with Conditional Compilation

Avatar of dhsimmons_sl
dhsimmons_sl asked on
Microsoft OfficeMicrosoft ApplicationsMicrosoft Development
1 Comment1 Solution680 ViewsLast Modified:
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
aikimark
Get vaccinated; Social distance; Wear a mask
Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros