Runtime Error 393: “Property Get can't be executed at run time,” explained and fixed
Error 393, “Property Get can't be executed at run time”, is the reading mirror of error 382. Code tried to read a property whose value the object will not supply at run time, because the property exists for the design environment: it describes how the object was configured in the editor, and the running object does not carry that information in a readable form. The statement is ordinary; the property's contract restricts when it can be read. The remedy is to stop asking the running object for design-time facts and track the needed value in code instead.
For people who just run the program
- This is a developer-facing error. It occurs in code that inspects controls or components while a program runs, for example diagnostic or reporting features that enumerate an object's properties.
- Note the feature. Features that read back how controls were configured, rather than what they currently contain, are the typical call sites.
- No document or setting influences it. The restriction is part of the component's design.
- Pass on the number. Error 393 tells the maintainer the code is reading a design-time property at run time; the fix is to source that value differently.
For people who write the code
- Check the property's availability notes. Component documentation marks properties that are unavailable at run time. If the property you are reading is one, no technique retrieves it from the running object; the information must come from design-time records or from your own variables.
- Track the value yourself. If run-time code needs a fact that was set at design time, capture it: read it in the designer-facing part of your code and store it in a variable, a Tag property, or a configuration store the running code can read.
' Instead of asking the control for a design-time fact at run time,
' keep the fact in your own state when it is established:
colWidthKey = "OrdersGrid.Name" ' your records, your rules
- In your own classes, mirror the rule honestly. If a property of your class only makes sense in the designer, raising a clear error is better than returning a plausible wrong value; callers hitting 393 at least learn the property is design-time only.
Error 393 is frequently met by property-enumeration tools. Code that loops through “all properties” of an arbitrary control will eventually read one that cannot execute at run time. Robust enumerators trap errors per property and skip the unreadable ones rather than dying on the first.
If it still happens
If documentation says the property is readable at run time, the object in hand may be a design-time surrogate rather than the real running object, for example a reference obtained from the editor's object model while a form is not actually running. Ensure the code reads from the live instance (the running form's controls), not from the designer's copy.
Common questions
What kinds of properties are design-time only? Typically properties that describe configuration rather than state: things meaningful while a developer arranges a control in the editor, which the compiled, running object does not preserve as readable values.
How is error 393 different from error 394? Error 394 is about direction: the property is write-only, so reading it is impossible in principle. Error 393 is about timing: reading is a design-time capability that the running object cannot perform.
Related errors