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.

2
  • Which version of Access are you using? Commented Aug 11, 2017 at 0:51
  • And which line of the VBA is highlighted when you get the error? Commented Aug 11, 2017 at 0:52

1 Answer 1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

I'm using access 2016. I'll give that a shot and see what happens.
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.