Read Excel in created helper object

Hi together

I’m new in using eggplant but with know how of using OOP.

I’ve reading the part of ‘Objects Designed to be Helpers’ of the eggplant documentation and want to create an helper that will handle my excel for advanced test sequences.

I tried to open the excel file in the created object but I got an error message, when I open the worksheet.
error: “Workbook Error - Wrong file type (must be ‘xls’ or ‘xlsx’ file): /Users/myUser/Workplace/{/}”

On the code line "set wsValues to Worksheet(excelWorkbook,1) " raise the error.

When I execute the Script Main_Second (see below) then I get no error, it just works. I cannot understand why the same code not works, if it is in a created helper ??

Can here somebody help?

here my code lines:

Script Main:

put new "Helpers/helperTestSequence" into testSequence
put testSequence.getStepList() into stepList

Script helperTestSequence

to getStepList
	try
		set excelWorkbook to Workbook(ResourcePath("Messages/Test_1.xlsx"))
		set wsValues to Worksheet(excelWorkbook,1)         // here will raise the error.
		// here read the excel content into a indexed list...
	catch excOpenFile
		throw excOpenFile
	end try
	// return the indexed list...
	return ixList
End getStepList

Script Main_Second:

put "Helpers/helperTestSequence".getStepList() into stepList

Please send problems like this to the support address. The forums are not intended for support issues.

When I have experienced similar issues, it was because of the ‘/’ inside the quotes (e.g. “Messages/Test_1.xlsx” Try moving the Excel to the Resources root folder and drop “Messages/” If it works then, ,you are on your way to troubleshooting the issue.

Hi
Sorry I didn’t know this is an issue. I thought I do something wrong.
Cheers

Hi, thanks for your answer. But didn’t help. So it will be an issue and I will contact the eggplant support as EggplantMatt did suppose.
Cheers.