# 设置为第一个工作表

## **函数原型**

```php
setCurrentSheetIsFirst(): self
```

## **实例**

```php
$config = ['path' => './tests'];
$excel  = new \Vtiful\Kernel\Excel($config);

$excel->fileName('hide.xlsx', 'sheet1') // 初始化文件，同时初始化第一张工作表 sheet1
    ->header(['sheet1'])       // 在 sheet1 工作表中插入数据
    ->addSheet('sheet2')       // 添加新工作表 sheet2，并设置当前活动工作表为 sheet2
    ->setCurrentSheetIsFirst() // 当前活动工作表为 sheet2，设置 sheet2 工作表为第一张工作表
    ->output();
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xlswriter-docs.viest.me/zhong-wen-jian-ti/worksheet/first.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
