# Read excel data/links in javascript test complete

**URL:** <https://community.smartbear.com/t/read-excel-data-links-in-javascript-test-complete/326>\
**Category:** TestComplete\
**Tags:** test, testcomplete, migrated, data-driven-testing, script-extensions, script-tests, web-testing, test-results, desktop-testing, variables\
**Created:** [November 18, 2022, 10:16am UTC](https://community.smartbear.com/t/read-excel-data-links-in-javascript-test-complete/326 "2022-11-18T10:16:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [November 18, 2022, 10:16am UTC](https://community.smartbear.com/t/read-excel-data-links-in-javascript-test-complete/326/1 "2022-11-18T10:16:23Z")

</div>

> Originally posted by **Ilakkk** on November 18, 2022

Hi team, I have tried to read the data file using javascript in test complete.But shows error as “Type error: cannot read the property ‘SheetByTitle’ of null”

**function** ExcelRead()  
{  
**var** excelFile = Excel.Open(“C:\temp\DataStorageExcel.xlsx”);  
**var** excelSheet = excelFile.SheetByTitle(“Sheet1”);

**var** valueA = excelSheet.Cell(“A”, 3).Value;  
**var** valueB = excelSheet.Cell(2, 3).Value;  
**var** valueC = excelSheet.CellByName(“C3”).Value;  
}

Can any one help regarding this issue or I want to fetch the weblinks from excel file one by one that links need to execute.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [November 18, 2022, 11:44am UTC](https://community.smartbear.com/t/read-excel-data-links-in-javascript-test-complete/326/2 "2022-11-18T11:44:48Z")

</div>

> Originally posted by **rraghvani** on November 18, 2022

There’s no problem with the code, as it works (using TC v15.45.31.7)

 ![rraghvani_0-1668771519091.png](https://canada1.discourse-cdn.com/flex049/uploads/smartbear_prod/original/1X/313a9b0a9c7f9268bc328b4115a2229378df8142.png)

I suggest you check your spreadsheet

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [November 18, 2022, 12:40pm UTC](https://community.smartbear.com/t/read-excel-data-links-in-javascript-test-complete/326/3 "2022-11-18T12:40:12Z")

</div>

> Originally posted by **Ilakkk** on November 18, 2022

Hey, Thanks a lot. I did small mistake while giving the path.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [November 21, 2022, 11:50am UTC](https://community.smartbear.com/t/read-excel-data-links-in-javascript-test-complete/326/4 "2022-11-21T11:50:10Z")

</div>

> Originally posted by **Ilakkk** on November 21, 2022

Hey one more help for me. For the same code how can I get the row/cell values one by one.

For example, in row I have stored some links first I want to hit the first link the script completed I want to hit next link and so on.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [November 21, 2022, 12:09pm UTC](https://community.smartbear.com/t/read-excel-data-links-in-javascript-test-complete/326/5 "2022-11-21T12:09:23Z")

</div>

> Originally posted by **rraghvani** on November 21, 2022

Use [For Loop](https://www.w3schools.com/js/js_loop_for.asp) to iterate through the cells.

---

<div class="post-metadata">

**Author:** ![system](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@system](https://community.smartbear.com/u/system)\
**Post date:** [October 7, 2026, 5:15pm UTC](https://community.smartbear.com/t/read-excel-data-links-in-javascript-test-complete/326/6 "2026-10-07T17:15:49Z")

</div>

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.
