WriteToExcel

The WriteToExcel component writes data to an Excel file.

Screenshot

Ports

The WriteToExcel component exposes the Control In, Control Out, Data In, and Data Out ports by default.

Port Description
ControlIn Must be connected to the Control Out port of one or more components.
ControlOut Can be connected to the Control In port of another component or the default end component.
Data In The WriteToExcel component exposes the following Data In ports:
FilePath (string): specifies the location of the file to which data is written.
SheetName (String): Specifies the name of the sheet you need the data to be written.
Data: specifies the DataTable to write to the file.

Properties

To edit the properties of the WriteToExcel component, in the lower-right pane, change the required property. You can edit the following properties.

Property Description
Search Search for the respective property.
Delay After Execution Specifies the wait time (in seconds) after the action is performed.
Delay Before Execution Specifies the wait time (in seconds) before the action is performed.

Example

Let us consider an example

Screenshot

To write data to an Excel file:

  1. Open Internet Explorer and type https://in.finance.yahoo.com/quote/AAPL?p=AAPL
  2. Locate the table as seen below.

    Screenshot

  3. In the Toolbox, expand Actions.

  4. Drag the GetTable component and drop it on the Design surface.
  5. To select the table to extract, click Screenshot.
    The Press “CTRL+SHIFT” for selection message is displayed.
  6. Press CTRL+SHIFT.
    The mouse pointer becomes a crosshair.
  7. Select the webpage content to extract.
    The selected content is displayed in the GetTable component.
  8. In the Toolbox, expand Utilities and then expand Data Writer.
  9. Drag the WriteToExcel component and drop it on the Design surface.
  10. To specify the data to write to the file, double-click the data box.
    The PORT PROPERTIES dialog box is displayed.
  11. In Read Data From, select Connection.

    Note

    In Read Data From, you can select Static or Variable instead of Connection. To learn more about the Connection or Variable data source override options, refer the Override section.

  12. Click OK.
    The Design surface displays the process flow.

  13. To specify the file location, double-click the FilePath box and enter the required file path.

    Note

    You can override the existing data source for both the data and the FilePath Data In ports. To override the existing data source:

    • Right-click the required Data In port.
    • Click Override and change the data source.
      To learn more about overriding the data source of the data port, refer the Override section.

  14. To override the default Boolean value of the Append data port, right-click the Append box and proceed as follows:

    • Click Override.
      The PORT PROPERTIES dialog box is displayed.
    • In Read Data From, select Static.

    Note

    In Read Data From, you can select Connection or Variable instead of Static. To learn more about the Connection or Variable data source override options, refer the Override section.

    • In Static Value, click the drop-down arrow and select “False”.
    • Click OK.
      The Design surface displays the process flow.
  15. Connect all the control ports in the activity.

  16. In the toolbar, click Run.
    The data is written to the specified Excel file.