F(x)

更新时间:
复制 MD 格式

open

open(file, visible=False, readonly=False, password=None, write_password=None, dispatch='wps')

Description

Opens an Excel file.

Metric Description

file <str> The file path.

visible <bool> Specifies whether the application window is visible.

readonly <bool> Specifies whether the file is read-only.

password <str> The password required to open the file.

write_password <str> The password for a write-protected workbook.

dispatch <str> Opens the file in Office or WPS.

Return value

Returns an Excel object <Excel>.

Example - rpa.app.wps.excel.open-

# Note: Confirm that WPS Office is installed before use.
# The following code provides an example:
excel_file_path = r"D:\2_TestFileArchive\TestExcel.xlsx"
excel = rpa.app.wps.excel.open(excel_file_path,visible=True)

create

create(visible=False, dispatch='wps')

Description

Creates an Excel file.

Parameters

visible <bool> Specifies whether the application window is visible.

dispatch <str> Opens the file with Office or WPS.

Return value

Returns an Excel object <Excel>.

Example - rpa.app.wps.excel.create-

# Note: Confirm that WPS Office is installed before use.
# The following code provides an example:
excel = rpa.app.wps.excel.create(visible=True)

catch

catch(name, mode='filename')

Description

Retrieves the object of an open Excel file.

Parameters

name <str> The file name or file path.

mode <str> The identification mode.

Options:

  • filename: The file name.

  • filepath: The file path.

Return value

Returns an Excel object <Excel>.

Example - rpa.app.wps.excel.catch-

# Note: Confirm that WPS Office is installed before use.
# To get an Excel file by its name, enter the file name with its extension.
# The following code provides an example:
excel = rpa.app.wps.excel.catch('TestExcel.xlsx')