US-12619816-B2 - Integrating external program code with spreadsheet application
Abstract
A data processing system implements receiving a first input in a spreadsheet in a spreadsheet application, detecting an indication that the first input includes first executable program code, analyzing the first executable program code to identify first references to one or more first elements of the spreadsheet in the first executable program code, requesting spreadsheet data associated with the one or more first elements of the spreadsheet from the spreadsheet application, receiving the spreadsheet data from the spreadsheet application; executing the first executable program code using the spreadsheet data referenced in the first executable program code to obtain a first program code result and causing the spreadsheet application to display the first program code result in the spreadsheet application.
Inventors
- Joseph John McDaid
- John Herbert Martin WILLIAMS
- Nicholas Charles WILSON
- Andrew Donald Gordon
- Neil TORONTO
- Anders Hejlsberg
- Guido Van Rossum
- Shaofeng Zhu
- Stephen DOWER
- John Lam
- Keyur Patel
- Arturo GOICOCHEA HOEFKEN
- Eoin Burke
- Su-Piao Wu
- James Masson
- Christopher Gross
- Jake Elliot Armstrong
- Carlos Augusto Otero
Assignees
- MICROSOFT TECHNOLOGY LICENSING, LLC
Dates
- Publication Date
- 20260505
- Application Date
- 20230821
Claims (10)
- 1 . A data processing system comprising: a processor; and a machine-readable storage medium storing executable instructions that, when executed, cause the processor alone or in combination with other processors to perform operations of: receiving a first input in a spreadsheet in a spreadsheet application; detecting an indication that the first input includes first executable program code, the first executable program code being associated with a first cell of the spreadsheet application and storing the first executable program code within the spreadsheet by storing the first executable program code in metadata associated with the first cell; presenting the first executable program code in a code editor panel of a user interface of the spreadsheet application; detecting a selection of one or more first elements of the spreadsheet in the user interface of the spreadsheet application; highlighting the one or more first elements of the spreadsheet in the user interface of the spreadsheet application responsive to detecting the selection of the one or more first elements; automatically updating the first executable program code to include one or more references to the one or more first elements of the spreadsheet responsive to detecting the selection of the one or more first elements to generate updated first executable program code; presenting the updated first executable program code in the code editor panel of the user interface of the spreadsheet application; highlighting the one or more references to the one or more first elements in the code editor panel of the user interface of the spreadsheet application; analyzing the first executable program code to identify first references to one or more first elements of the spreadsheet in the first executable program code; requesting spreadsheet data associated with the one or more first elements of the spreadsheet from the spreadsheet application; receiving the spreadsheet data from the spreadsheet application; executing the first executable program code using the spreadsheet data referenced in the first executable program code to obtain a first program code result; causing the spreadsheet application to display the first program code result in the spreadsheet application; monitoring changes to the spreadsheet that affect the one or more first elements of the spreadsheet; detecting a change to the spreadsheet that updates the first references to the one or more first elements in the spreadsheet; generating updated references to the one or more first elements based on the change to the spreadsheet; and automatically updating the first executable program code with the updated references in response to detecting the change the spreadsheet.
- 2 . The data processing system of claim 1 , wherein the machine-readable storage medium further includes instructions configured to cause the processor alone or in combination with other processors to perform operations of: causing the spreadsheet application to present the first executable program code in a first editor pane in the spreadsheet application; detecting a first user input selecting a first reference to the one or more first elements; and causing the spreadsheet application to highlight the one or more first elements in the spreadsheet in response to detecting the first user input.
- 3 . The data processing system of claim 2 , wherein the machine-readable storage medium further includes instructions configured to cause the processor alone or in combination with other processors to perform operations of: detecting a second user input via a first control element of the first editor pane; configuring the first editor pane and the spreadsheet application to operate in a first editor mode responsive to detecting the second user input, the first editor mode causing the spreadsheet application to monitor user selections of elements within the spreadsheet and to provide references to the user selections to the first editor pane; detecting a third user input selecting one or more second elements of the spreadsheet; providing references to the one or more second elements to the first editor pane; and automatically inserting a representation of the references to the one or more second elements into the first executable program code.
- 4 . The data processing system of claim 3 , wherein the machine-readable storage medium further includes instructions configured to cause the processor alone or in combination with other processors to perform operations of: receiving a second input associated with a second cell in the spreadsheet in the spreadsheet application; detecting the indication that the second input includes second executable program code; analyzing the second executable program code to identify second references to one or more second elements of the spreadsheet in the second executable program code; requesting spreadsheet data associated with the one or more second elements of the spreadsheet from the spreadsheet application; receiving the spreadsheet data from the spreadsheet application; executing the second executable program code using the spreadsheet data referenced in the second executable program code to obtain a second program code result; causing the spreadsheet application to store the second program code result in the spreadsheet application; and causing the spreadsheet application to present the first executable program code in a second editor pane in the spreadsheet application.
- 5 . The data processing system of claim 4 , wherein the machine-readable storage medium further includes instructions configured to cause the processor alone or in combination with other processors to perform operations of: causing the spreadsheet application to display a code editor panel, wherein the code editor panel presents the first editor pane associated with the first executable program code and the second editor pane associated with the second executable program code in an order of execution of the first executable program code and the second executable program code.
- 6 . The data processing system of claim 5 , wherein the machine-readable storage medium further includes instructions configured to cause the processor alone or in combination with other processors to perform operations of: detecting a third user input via a second control element of the code editor panel; causing the code editor panel to display a third editor pane for third executable program code; receiving an indication of a third cell of the spreadsheet to associate with the third executable program code; receiving third program code via the third editor pane; and associating the third program code with the third cell of the spreadsheet.
- 7 . A method implemented in a data processing system for integrating executable program code with a spreadsheet application, the method comprising: receiving a first input in a spreadsheet in a spreadsheet application; detecting an indication that the first input includes first executable program code, the first executable program code being associated with a first cell of the spreadsheet application and storing the first executable program code within the spreadsheet by storing the first executable program code in metadata associated with the first cell; presenting the first executable program code in a code editor panel of a user interface of the spreadsheet application; detecting a selection of one or more first elements of the spreadsheet in the user interface of the spreadsheet application; highlighting the one or more first elements of the spreadsheet in the user interface of the spreadsheet application responsive to detecting the selection of the one or more first elements; automatically updating the first executable program code to include one or more references to the one or more first elements of the spreadsheet responsive to detecting the selection of the one or more first elements to generate updated first executable program code; presenting the updated first executable program code in the code editor panel of the user interface of the spreadsheet application; highlighting the one or more references to the one or more first elements in the code editor panel of the user interface of the spreadsheet application; analyzing the first executable program code to identify first references to one or more first elements of the spreadsheet in the first executable program code; requesting spreadsheet data associated with the one or more first elements of the spreadsheet from the spreadsheet application; receiving the spreadsheet data from the spreadsheet application; executing the first executable program code using the spreadsheet data referenced in the first executable program code to obtain a first program code result; causing the spreadsheet application to display the first program code result in the spreadsheet application; monitoring changes to the spreadsheet that affect the one or more first elements of the spreadsheet; detecting a change to the spreadsheet that updates the first references to the one or more first elements in the spreadsheet; generating updated references to the one or more first elements based on the change to the spreadsheet; and automatically updating the first executable program code with the updated references in response to detecting the change the spreadsheet.
- 8 . The method of claim 7 , further comprising: causing the spreadsheet application to present the first executable program code in a first editor pane in the spreadsheet application; detecting a first user input selecting a first reference to the one or more first elements; and causing the spreadsheet application to highlight the one or more first elements in the spreadsheet in response to detecting the first user input.
- 9 . The method of claim 8 , further comprising: detecting a second user input via a first control element of the first editor pane; configuring the first editor pane and the spreadsheet application to operate in a first editor mode responsive to detecting the second user input, the first editor mode causing the spreadsheet application to monitor user selections of elements within the spreadsheet and to provide references to the user selections to the first editor pane; detecting a third user input selecting one or more second elements of the spreadsheet; providing references to the one or more second elements to the first editor pane; and automatically inserting a representation of the references to the one or more second elements into the first executable program code.
- 10 . The method of claim 9 , further comprising: receiving a second input associated with a second cell in the spreadsheet in the spreadsheet application; detecting the indication that the second input includes second executable program code; analyzing the second executable program code to identify second references to one or more second elements of the spreadsheet in the second executable program code; requesting spreadsheet data associated with the one or more second elements of the spreadsheet from the spreadsheet application; receiving the spreadsheet data from the spreadsheet application; executing the second executable program code using the spreadsheet data referenced in the second executable program code to obtain a second program code result; causing the spreadsheet application to store the second program code result in the spreadsheet application; and causing the spreadsheet application to present the first executable program code in a second editor pane in the spreadsheet application.
Description
BACKGROUND Spreadsheet applications enable users to store data in a two-dimensional array arranged in rows and columns. Moreover, spreadsheet applications provide tools that enable users to store, organize, and analyze data in various ways. For example, spreadsheet applications often include built-in formulas that enable users to manipulate data in various ways. However, uses often wish to perform complex calculations and/or manipulate the data in complex ways that are difficult to implement using built-in formulas due to their limited syntax and inflexibility. To address this problem, some users prefer to utilize an external programming language that enables the user to write executable program code that suites the specific needs of the user. However, current spreadsheet applications do not provide means for integrating such external program code with the spreadsheet application. Neither the programming language nor the spreadsheet provides a native means for referencing spreadsheet objects within the program code. Consequently, such solutions could not be readily integrated with the spreadsheet application to enable users to write and execute external programming code with a spreadsheet in a spreadsheet application. Hence, there is a need for improved systems and methods of integrating executable program code with a spreadsheet application. SUMMARY An example data processing system according to the disclosure may include a processor and a machine-readable medium storing executable instructions. The instructions when executed cause the processor alone or in combination with other processors to perform operations including receiving a first input in a spreadsheet in a spreadsheet application; detecting an indication that the first input includes first executable program code; analyzing the first executable program code to identify first references to one or more first elements of the spreadsheet in the first executable program code; spreadsheet data associated with the one or more first elements of the spreadsheet from the spreadsheet application; receiving the spreadsheet data from the spreadsheet application; executing the first executable program code using the spreadsheet data referenced in the first executable program code to obtain a first program code result; and causing the spreadsheet application to display the first program code result in the spreadsheet application. An example method implemented in a data processing system for integrating executable program code with a spreadsheet application includes receiving a first input in a spreadsheet in the spreadsheet application; detecting an indication that the first input includes first executable program code; analyzing the first executable program code to identify first references to one or more first elements of the spreadsheet in the first executable program code; requesting spreadsheet data associated with the one or more first elements of the spreadsheet from the spreadsheet application; receiving the spreadsheet data from the spreadsheet application; executing the first executable program code using the spreadsheet data referenced in the first executable program code to obtain a first program code result; and causing the spreadsheet application to display the first program code result in the spreadsheet application. An example data processing system according to the disclosure may include a processor and a machine-readable medium storing executable instructions. The instructions when executed cause the processor alone or in combination with other processors to perform operations including receiving first executable program code at an external program code pipeline of a spreadsheet application, the first executable program code being associated with a first cell of a spreadsheet; analyzing the first executable program code to identify first references to one or more first elements of the spreadsheet in the first executable program code; obtaining spreadsheet data associated with the one or more first elements of the spreadsheet from the spreadsheet application; executing the first executable program code using the spreadsheet data referenced in the first executable program code to obtain a first program code result; and causing the spreadsheet application to display first program code result in the first cell of the spreadsheet. This Summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This Summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Furthermore, the claimed subject matter is not limited to implementations that solve any or all disadvantages noted in any part of this disclosure. BRIEF DESCRIPTION OF THE DRAWINGS The drawing figures depict one or more implementations in accord with the present teachings, by way of example onl