UnprotectedAccess

Returns a reference to a value that bypasses the usual access checks on private members.

Syntax: UnprotectedAccess( Variable ) As Object

Variable
required The value to wrap. The value passed is taken As Any so the call works for any type.

The returned object exposes Variable’s members — including Private and Friend ones — without triggering the access enforcement that the compiler ordinarily applies. Useful for testing, serialization, and other reflection-style scenarios that legitimately need to reach inside an encapsulation boundary.

See Also