> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# 循环Excel内容

## 指令说明

**描述：** 按行循环Excel对象的内容，并保存循环项。

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/XU4apql8B34CRdwD/helpcenter/commands/excel/images/loopexcelsheetcommand-01.png?fit=max&auto=format&n=XU4apql8B34CRdwD&q=85&s=91e4c78bb1624287cb7bdec7f815d927" alt="循环Excel内容指令参数面板" width="646" height="524" data-path="helpcenter/commands/excel/images/loopexcelsheetcommand-01.png" />

    | 参数           | 说明                                                         |
    | ------------ | ---------------------------------------------------------- |
    | **Excel对象**  | 请选择Excel对象（可通过指令【启动Excel】或【获取当前激活的Excel对象】创建），用于确定待操作的工作簿。 |
    | **Sheet页名称** | 操作目标工作表的名称，支持选填，默认为当前Excel激活的Sheet页。                       |
    | **起始行**      | 循环的起始行号，第一行从1开始。                                           |
    | **结束行**      | 循环的结束行号，最后一行可用-1表示。                                        |
  </Tab>

  <Tab title="高级">
    | 参数             | 说明                                                            |
    | -------------- | ------------------------------------------------------------- |
    | **读取单元格显示的内容** | 若勾选，则读取的内容将与Excel中显示的内容一致，且始终以文本的形式返回；若不勾选，则返回的内容将根据数据类型进行转换。 |
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/XU4apql8B34CRdwD/helpcenter/commands/excel/images/loopexcelsheetcommand-02.png?fit=max&auto=format&n=XU4apql8B34CRdwD&q=85&s=fde586704a2769d03a339e3ec1f49595" alt="循环Excel内容使用示例 - 流程搭建" width="887" height="291" data-path="helpcenter/commands/excel/images/loopexcelsheetcommand-02.png" />

**该流程执行逻辑：**

使用【启动Excel】打开已有的Excel，并将Excel对象保存到excel对象

使用【循环Excel内容】指令循环工作表中从第1行到最后1行的内容，并将循环项保存到「loop\_excel」变量中

使用【打印日志】打印变量「loop\_excel」

使用【关闭Excel】指令关闭并保存excel对象

### 效果展示

<img src="https://mintcdn.com/bazhuayu-rpa-docs/XU4apql8B34CRdwD/helpcenter/commands/excel/images/loopexcelsheetcommand-03.png?fit=max&auto=format&n=XU4apql8B34CRdwD&q=85&s=ea2c0397ae7a750e39a8e3fd5abb932c" alt="循环Excel内容使用示例 - 效果展示" width="1339" height="184" data-path="helpcenter/commands/excel/images/loopexcelsheetcommand-03.png" />

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
