Wednesday, April 16, 2014

How to detect, if you are running 64-bit Office

New data type LongPtr is Long integer on 32-bit systems and LongLong integer on 64-bit systems, by checking it VarType you can find out on what environments you run your VBA code:

Function Is64BitOffice() As Boolean
    Dim lp As LongPtr
    Is64BitOffice = Not (VarType(lp) = vbLong)
End Function

This trick I learned from fellow MVP Brent Spaulding

3 comments:

  1. Anonymous7:27 PM

    Doesn't work for me. It Errs?!

    ReplyDelete
  2. It should work on Access 2010 or 2013...

    ReplyDelete