Forum Discussion

windend's avatar
windend
Occasional Contributor
14 years ago

How to know sheet is not present in Excel workbook with DDT.ExcelDriver

hi, I'm using DDT.ExcelDriver to fetch data in excel like this :



excelDriver = DDT.ExcelDriver(excelPath,sheetName)



However, sometimes the sheetName is not present in my excel workbook, and above statement will be executed without any errors. Is there any way to judge whether my "excelDriver" is right in advance? which something likes:



if isNull(excelDriver) or excelDriver = nothing then

Log.Message(sheetName &"is not present in excel file"&excelPath)

end if



Or we can only know this by Error Numbers? Thank you.