Last activity: 26 Oct 2022 6:52 EDT
Robotics Tip of the day: Casting data objects on blocks (Treat as)
Tip #24: When a property or method accepts or returns one type and you need the result to be a different type, use the Treat as option to change the type on the block.
For instance, when using methods on the Microsoft Office connectors, many methods accept parameters that are generic objects and return the result as a generic object. To fully access the result you need to convert the result to be an object of a specific type.
To change the type for a parameter on an automation block, right-click the property name and select Advanced > Treat as > Pick type. Then select the type that you need. Notice how much easier the after version is to read compared to the before version:
Note: Click here to see the latest Tip of the Day and a list of all prior tips.