# Using .xlsx sheet name in datadriven robotframework

**URL:** <https://forum.robotframework.org/t/using-xlsx-sheet-name-in-datadriven-robotframework/8422>\
**Category:** Libraries\
**Created:** [7 February 2025 15:16 UTC](https://forum.robotframework.org/t/using-xlsx-sheet-name-in-datadriven-robotframework/8422 "2025-02-07T15:16:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![GunasekaranMP](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/gunasekaranmp/32/4532_2.png) [@GunasekaranMP](https://forum.robotframework.org/u/GunasekaranMP)\
**Post date:** [7 February 2025 15:16 UTC](https://forum.robotframework.org/t/using-xlsx-sheet-name-in-datadriven-robotframework/8422/1 "2025-02-07T15:16:53Z")

</div>

I am using datadriven library in robotframework the windows excel, the file format of .xlsx. I’ve two sheets in it, but when, I call the .xlsx file and with the sheet name, it not fetching file and sheet name

**Test Script:**  
\*\*\* Settings \*\*\*  
Library DataDriver file=C:\Users\u421643\AppData\Roaming\JetBrains\Aqua2024.3\extensions\com.intellij.database\ROBOT\_FRAMEWORK\datadriven.xlsx  
… sheet\_name=Sheet1  
Test Template Test Case Keyword 1

\*\*\* Keywords \*\*\*  
Test Case Keyword 1  
[Arguments] ${username} ${password}  
Log ${username}  
Log ${password}

\*\*\* Test Cases \*\*\*  
The Test Execution ${username} ${password}  
[Tags] data\_driven

**Data sheet:**  
For Sheet 1:

| \*\*\* Test Cases \*\*\* | ${username} | ${password} | [Tags] | [Documentation] |
| --- | --- | --- | --- | --- |
| Right user empty pass | demo | ${EMPTY} | 1 | This is a test case documentation of the first one. |
| Right user wrong pass | demo | FooBar | 2,3,foo | This test case has the Tags 2,3 and foo assigned. |
| | ${EMPTY} | mode | 1,2,3,4 | This test case has a generated name based on template name. |
| | ${EMPTY} | ${EMPTY} | | |
| | ${EMPTY} | FooBar | | |
| | FooBar | mode | | |
| | FooBar | ${EMPTY} | | |
| | FooBar | FooBar | | |

sheet 2:

| \*\*\* Test Cases \*\*\* | ${username} | ${password} | [Tags] | [Documentation] |
| --- | --- | --- | --- | --- |
| Test 2-sheet | 1 | 2 | 3 | 4 |

the execution report  
[ERROR] Calling method ‘\_start\_suite’ of listener ‘DataDriver’ failed: ImportError: Requirements (pandas, openpyxl) for XLSX support are not installed.  
Use ‘pip install -U robotframework-datadriver[XLS]’ to install XLSX support.

---

<div class="post-metadata">

**Author:** ![HelioGuilherme66](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/helioguilherme66/32/34_2.png) [@HelioGuilherme66](https://forum.robotframework.org/u/HelioGuilherme66)\
**Post date:** [7 February 2025 15:50 UTC](https://forum.robotframework.org/t/using-xlsx-sheet-name-in-datadriven-robotframework/8422/2 "2025-02-07T15:50:29Z")

</div>

> [@GunasekaranMP](#):
>
> ImportError: Requirements (pandas, openpyxl) for XLSX support are not installed.  
> Use ‘pip install -U robotframework-datadriver[XLS]’ to install XLSX support.

And this error, did not gave a clue to you?

---

<div class="post-metadata">

**Author:** ![GunasekaranMP](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/gunasekaranmp/32/4532_2.png) [@GunasekaranMP](https://forum.robotframework.org/u/GunasekaranMP)\
**Post date:** [9 February 2025 14:04 UTC](https://forum.robotframework.org/t/using-xlsx-sheet-name-in-datadriven-robotframework/8422/3 "2025-02-09T14:04:49Z")

</div>

I’ve installed these packages pip install -U robotframework-datadriver[XLS], pandas, openpyxl. Even after installation, I am facing this.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [9 February 2025 14:17 UTC](https://forum.robotframework.org/t/using-xlsx-sheet-name-in-datadriven-robotframework/8422/4 "2025-02-09T14:17:52Z")

</div>

Hi Gunasekaran,

For some reason when datadriver library runs it’s not finding those packages.

this could be because you have multiple versions of python installed or it could be related to python virtual environments. You need to make sure when you run those pip commands to install those packages, you do it in the same python environment as what robot framework is in, but you haven’t given enough details about your environment for us to be able to tell what you need to do.

I hope this helps,

Dave.
