Forum Discussion
Depends upon what you intend to do with the data. If the data is a set of data that you're going to use to drive a loop, then you would use the DDT.ExcelDriver object or a Data Driven Loop in Keyword Tests using the Excel file.
If you're looking at simply retrivieving data from the file and processing it into something else, not necessarily in a loop, then I would use Sys.OleObject('Excel.Application') to access the Excel application object and work with it.
If you could give us more details as to what you're intending, we can target you to the best solution.
Ok At this time I want to simply retrieve the data from Excel file and process that excel data .
Thanks
Nishchal
- tristaanogre9 years agoEsteemed Contributor
Check out this topic:
https://support.smartbear.com/testcomplete/docs/testing-with/advanced/working-with-external-data-sources/excel/working-via-com.html- nisgupta9 years agoValued Contributor
Thanks for the updates
Let's suppose that if we run the script from remote machine then the following statement will not work
Excel.Workbooks.Open("C:\\MyFile.xls");
How can we handle ?
Thanks
NG
- tristaanogre9 years agoEsteemed Contributor
What I would do is make sure that any Excel files that you use in your project are stored with the project path. There is a property Project.Path that will return the path of where the MDS file is for your automation project. So, if you do
Excel.Workbooks.Open(Project.Path + "\\MyFile.xls");
This will then look for the file in whatever the current path is. So, if you go to a different machine, the file will always be referenced relative to the project path.