Was wondering if there was an easier way to edit the content of an excel file? More specifically, is there a way i can reference specific cells?
I have a file that i use to validate test results. This file has variable content dependant on what the value of a certain cells is. I would like to make the updating of this file an automated process instead of having to manually open the file edit the value and close it, due to the size of the file this is a very time consuming process.
At the moment i have done it through a very ugly hack, that is easily broken.
var CommStruct = UserForms.Main.CommStructure.ItemIndex+1;
var file = UserForms.Main.FilePath.Lines.Text+"[Enter]";
import this excel file into test complete as a table or DB rather than using the DDT.ExcelDriver method?
You can use ADO to read Excel files. However, it is similar to DDT, so there's no reason to do this. Also, you can read them via COM (via the properties and methods used in the example I referred to above).
------ Yuri TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
I find DDT is short supplied for methods. Like to browse across the cells I have to keep looping around with the "Next" function because cannot access the cells directly and for a "Next" I don't find a "Previous" that can help me browse backward. Also I could not find any method that could help me write data into the spreadsheet. Say I want to use an order number generated in a flow as input in the flow later and therefore want to store in my data store. I found COM as the coolest approach. Wrote a custom script extn with an object called DataSheet.
In the script I have would use
Result = DataSheet.GetAccess(FileName)
Result = DataSheet.LooseAccess(FileName)
Result = DataSheet.GetData(Sheetname, FieldName, Iteration)
Result = DataSheet.SetData(Sheetname, FieldName, Iteration, Value)
Result = DataSheet.FindValue(Sheetname, Value, SearchAllBool)
Result = DataSheet.SortValues(SheetName, FieldName, AscDesBool)
Result = DataSheet.FieldResultsCompare(Sheet1, Field1, Sheet2, Field2, ResSheet, ResField)