Index outside the bounds of an array - Printable Version +- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums) +-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP) +--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners) +--- Thread: Index outside the bounds of an array (/Thread-Index-outside-the-bounds-of-an-array) |
Index outside the bounds of an array - J112910f - 12-28-2010 Ok, so right now I'm filling out a data grid in my application. I've done numerous grids only this particular one is giving me trouble. Normally if i get this error, its because I have defined a row outside of the rows available, but in this case even using the recording tool with hard values I run into problems. So this is my code: Code: SwfWindow("MS ProContractorMX").SwfTable("BaseGridView_Proj_Invoice").SetCellData Invoice_PCMX_Row,"TotalQuantity",datatable("Invoice_Units_Rev_Quantity", dtGlobalsheet) Where at this particular loop: Invoice_PCMX_Row = 0, and datatable("Invoice_Units_Rev_Quantity", dtGlobalsheet) = 10 however, even if I record to get hard values and get: Code: SwfWindow("MS ProContractorMX").SwfTable("BaseGridView_Proj_Invoice").SetCellData "0","TotalQuantity","10" I still get the same error: IG : Code: [SetCellData] : Index was outside the bounds of the array. Is there anyway I can ask which array its using? (I'm assuming its the Grid) I can provide more of my code if its required its just that its part of a large function. Thanks for the help, Jay RE: Index outside the bounds of an array - yagarules - 12-29-2010 Hi, maybe you should try to start from 1 instead of 0, or Check your column name by the index. Try it and tell us, |