In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
How to use SAP Intelligent Robotic Process Automation automatic operation of Excel, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail for you, people with this need can come to learn, I hope you can gain something.
In addition to programming languages, SAP's newly released SAP Intelligent Robotic Process Automation (SAP iRPA) provides a powerful enterprise-level automation process solution that can be used flexibly to operate Excel without programming.
Let's look at a concrete and simple example. Use SAP Intelligent Robotic Process Automation to manipulate an Excel file, write a string to the cells inside, set the background color, and then close it.
Open SAP Intelligent Robotic Process Automation Desktop Studio and import the nodejs script library file of the operation Excel preset by SAP.
Select Excel Integration in the library file. As can be seen from the figure below, besides Excel, SAP iRPA also supports other applications in Office, such as Word and Outlook.
Create a new workflow called jerryExcel, type seq in the activities panel of the workflow, and find the Flow control of type Sequence. This control allows us to define a series of sequentially executed steps in the workflow.
Drag the Sequence control to the workflow editing area and double-click to define the detailed steps that need to be performed.
There are many operations around Excel in Excel Lib, such as Init Excel,Open Excel,Close Excel, etc., each operation corresponds to a piece of nodejs code.
For example, after dragging Init Excel to the Activities list of the Sequence control, once you save it, you will immediately see the automatically generated nodejs code. Each step in Excel Lib corresponds to a piece of nodejs code. In this way, even if the users of SAP Intelligent Robotic Process Automation Desktop Studio do not have a programming foundation, they can develop automated workflows that can operate Excel.
The Init Excel step in the figure above is an initialization step that all workflows that operate on Excel must perform. After initialization, drag the Open Excel step into Sequence Activities, specify the path of the Excel file to open, and there is a red prompt in Desktop Studio.
Maintain the absolute path of the local Excel file:
The third step is to set the first row of the open Excel, and the value of the first column is' Hello Jerry':
Step 4, set the background color of row 1 and column 1:
Save the modified Excel to another file. Execute this project and you will see another Excel file in the temp folder.
This example is very simple. Let's look at how it works.
Switch to the Script panel, set a breakpoint at line 45 where you open the code for Excel, and then step into debugging:
Once the breakpoint is triggered, we can observe an application window prompt for Excel in the taskbar without showing anything:
You can see that the application is launched with the parameter * * / automation-Embedding** in the task manager:
We want to debug the ctx.excel.file.open method step by step, and find that the breakpoint does not stop in the open method, but directly executes the method. At this time, the application title on the taskbar has been changed from Excel to the file name opened by the open method: 1.xlsx.
From the / automation and embedding parameters observed in the above task manager, we can tell that the implementation principle of SAP iRPA operating Excel is consistent with the first method mentioned in the Jerry article [* * several ways to operate Excel using ABAP * *] (several ways to operate Excel using ABAP), that is, operating Excel through OLE.
If you want to get to the bottom of the problem, you can go to the SAP iRPA SDK installation directory, open the excel.js file, find the implementation of the open method, and find that it calls the WorkBooks.Open method of the _ excelApp object:
The _ excelApp object is obtained from the OLE object Excel.Application through GetObject in the initialize method:
Remember the source code of the ABAP OLE implementation mentioned in the Jerry article [several ways to operate Excel with ABAP] (several ways to operate Excel with ABAP)? It also uses the same way to obtain Excel application objects, even in the same way of coding.
Now that we have talked about the topic of JavaScript operating Excel, by the way, another popular open source library for JavaScript operating Excel, that is, * * Node-xlsx**, principle is based on Office Open XML protocol to parse Excel files, and ABAP also has a corresponding Office Open XML-based implementation: * * CL_XLSX_DOCUMENT**.
Compared with the OLE solution adopted by SAP iRPA, this approach has the advantage of avoiding the dependence on Excel applications and is mostly used for server-side processing tasks of Excel.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.