Recorded Spreadsheet Operations Combined for Portable Macro Code
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing systems for generating macro code from user operations in electronic document applications, such as spreadsheets, do not effectively combine operations, leading to inefficient and less readable code.
Innovation Solution
A system and method for combining and aliasing entities in recorded operations, using a recorder application to generate macro code that reduces the number of operations and improves readability by employing a code tree traversal and aliasing entities.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of operation
If multiple operations are recorded separately in macro code, then each operation can be individually tracked and executed, but the code becomes lengthy and less readable
Solution Approach 1:
The patent combines multiple separate operations into a single composite operation by detecting operations of the same type acting on adjacent cells. Instead of recording each cell operation individually, the system merges them into one operation that acts on a range of cells, thereby reducing code length and improving readability while maintaining the ability to track and execute each underlying operation.
2Productivity
If operations are combined into fewer lines of code, then the macro code becomes more concise and readable, but the complexity of processing and generating the code increases
Solution Approach 1:
The code generation system is segmented into distinct functional modules: an operation detection module that identifies operations of the same type, a merging module that combines adjacent operations, and a code generation module that produces the final macro code. This segmentation allows the system to handle the complexity of operation combining through specialized sub-components rather than a monolithic complex system.
Solution Approach 2:
The system performs preliminary analysis of recorded operations before generating macro code. It pre-processes the operation sequence to identify and group combinable operations, determining which operations can be merged based on their type and the adjacency of their target cells. This preliminary action simplifies the subsequent code generation process by providing a pre-organized structure of combinable operations.
3Reliability
If macro code is generated to perform operations on specific cells, then the code accurately reproduces user actions, but the code becomes less portable to different spreadsheets
Solution Approach 1:
The generated macro code uses relative references and range-based operations that can adapt to different spreadsheet contexts. By combining operations into range-based commands rather than cell-specific commands, the code becomes more universal and can be applied to different spreadsheets with similar structures, enhancing portability while maintaining accurate reproduction of the intended operations through the range abstraction.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
Disclosed in some examples are methods, systems, devices, and machine-readable mediums for combining activities in recorded code. A method is disclosed that includes receiving a first indication of a first operation and a second indication of a second operation from an electronic document application, the first indication of the first operation indicating that the first operation is performed on a first cell of the electronic document application and the second indication of the second operation indicating the second operation is performed on a second cell. The method may include determining a range of cells expression. The method may further include generating code within the recorder application comprising the range of cells expression that when executed within the recorder application causes an operation of the same type as the first operation and the second operation to be performed by the electronic document application on the first cell and the second cell.