I am facing two problems..
1)When I am trying to get data from excel sheet and fillign in my application while testing.Its workign fine for all except when the value from excel sheet is numerical value and if I am using it to fill Weblist item. I am getting an error.Ex: If I get value 1994 for year and tryign to fill a Dropdown list.. I am getting error.
What I observed is Whenever I am reading a numerical value from excelsheet and tryign to fill Dropdown list I am facing error..For everything else its working fine..
2)To avoid the above problem I tried to use 'DataTable.ImportSheet' method instead of directly reading from the excel sheet..in my function. This way i was successful in avoiding the problem..but I am facing some other problem like script is going into infinite loop.
Do we need to give some command to close Datatable whenever we use Import.DataTable statement?
If anyone faced similar problem and gto the solution..Please respond..If you would like me to attach the code I will do..
Re: Importing Excel Sheet to DataTable in a Function
For you 1st point...
A weblist will only take values i.e. select a value from the list if the exact data is supplied to it otherwise it will throw an error message.
Check the properties of the weblist and see if you have a space after 1994 or before ..I mean check if the value you are supplying to the weblist is exactly same as on the properties..Give a msgbox command when you retrieve the value from excel sheet and see what data is being pulled from excel
For your 2nd point, need more detail..when you say going into infinite loop..do you mean retieving data is going to a loop or actions on your app is going into a loop
Re: Importing Excel Sheet to DataTable in a Functi
What was the error? I've found sometimes there will be trailing or leading spaces either in the dropdown or in the data that will cause the step to fail. Regarding importing data from excel sheets, i've never used the import method, but there are some great functions found here: