1

Trying to fix the recent "Scriptlet.TypeLib" problem and tried to follow a solution outlined here: MS Access VBA Error: Run time error '70' Permission Denied in Access but I keep getting a "user-defined type not defined" error.

Ryan
  • 83
  • 1
  • 2
  • 9

1 Answers1

1

If you're using the code as posted in the other SO answer, and your compile error is occurring on this line,

Private Declare PtrSafe Function CoCreateGuid Lib "ole32.dll" (Guid As GUID_TYPE) As LongPtr

then it's likely because you're using an older version of Access (and a 6.x version of VBA), that is unaware of the LongPtr keyword. You should be able to just substitute Long for every instance of LongPtr.

ThunderFrame
  • 9,352
  • 2
  • 29
  • 60
  • I'm using access 2016. I'll give that a shot and see what happens. – Ryan Aug 11 '17 at 01:39
  • 1
    Thanks @thunderFrame, that worked. Like I mentioned this was Access 2016 but I still had to change it from LongPtr to Long. I don't know that I would have ever figured that out. Thanks again. – Ryan Aug 11 '17 at 06:30