Hi Team,
I want to read the Excel data and get the Data table by using vb.net code.
I have tried with excel and workbook activities.workbook Readrange is not working as the excel sheet contains .xls extension.and excel application scope is working but sometimes getting stuck .so wanted to check by using VB.net.
Please send me the code details or any small example by using invoke code activity.
I’m sharing links that I think will help. I hope that will be useful. Also have you tried upgrading or downgrading the Excel activity pack and running it?
Sir,
I have tried with Excel,the problem is sometimes the Robot is getting stuck at the Excel Application scope activity.The reason i found from the forum is sometimes excel is searching for license which maybcsuse the Robot stuck .so to avoid this i ttied with Wotkbook read range.that is also creating problem.
Dim myConnection As system.data.OleDb.OleDbConnection
Dim dtset As system.data.DataSet
Dim MyCommand As system.data.OleDb.OleDbDataAdapter
myConnection=New system.Data.OleDb.OleDbConnection(“Provider=Microsoft.ACE.OLEDB.6.0;Data Source=‘D:\Employee.xls’;Extended Properties=‘Excel 4.0;HDR=Yes;IMEX=1;’”)
MyCommand=New System.Data.OleDb.OleDbDataAdapter(“select * from [Sheet1]”,myConnection)
dtset=New System.Data.DataSet
MyCommand.Fill(dtset)
As Read range workbook was not working for .xls file ,i have saved(Save as) the file again in to .xlsx by using invoke code activity.and Used read range workbook activity yo get the data table.And now its working as expected.