Forum Discussion
hey, i took your code and then ran it, it seems to work on my end when i run the testexcel() function.
from os import sys
sys.path.insert(0, 'C:\\Users\\justin.kim\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages')
import openpyxl
def ExcelReadSingleCell(Sheet,Cell):
excelPath = "C:\\Users\\justin.kim\\Desktop\\test.xlsx"
wb = openpyxl.load_workbook(excelPath )
ws = wb.get_sheet_by_name(Sheet)
mycell=ws[Cell]
return str(mycell.value)
def testExcel():
Log.Message(ExcelReadSingleCell("Sheet1", "D3"))
Log.Message(ExcelReadSingleCell("Sheet1", "D4"))
Log.Message(ExcelReadSingleCell("Sheet1", "D5"))
Log.Message(ExcelReadSingleCell("Sheet1", "C3"))
Log.Message(ExcelReadSingleCell("Sheet1", "C5"))
I'd suggest filing for a support ticket, and the support engineers will guide you through using probably the report generator utility to take a look at your system and see if they can identify what the problem is with TestComplete when you are running your system. With that said, I have personally experience some problems too when using external libraries, like random closing of testcomplete. So to achieve this goal right now, I'd suggest looking into using the Sys.OleObject["Excel.Application"] object to interact with your spreadsheets.
Thank you for the response,
whereas there's no issue with TC, it was happening due to Python library NumPy, which is been used in another unit of the suite, resolution provided by support team.
Further details related to issue can be found here
Related Content
- 2 months ago
Recent Discussions
- 22 hours ago
- 22 hours ago
- 5 days ago