Forum Discussion

ḥari's avatar
ḥari
Frequent Contributor
2 years ago

Fetch the row count in DDT driver

Hi,

I have both row and column values in excel. Using DDT driver I have only seen column count there "https://support.smartbear.com/testcomplete/docs/testing-with/data-driven/drivers.html".

Noticed that first and next methods for drivers looping.

I need to fetch exact row values also
Can any one help me out
  • Sorry, my previous response was lazy. Here's an example,

     

     

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Sorry, my previous response was lazy. Here's an example,

     

     

    • ḥari's avatar
      ḥari
      Frequent Contributor
      It's fetched the exact values, I did a bit mistake there, thank you
    • ḥari's avatar
      ḥari
      Frequent Contributor
      In working with excel files via COM to fetch the sheet values "active sheet" they used instead of that can i mention the name of the sheet if we have multiple sheet in one excel file
    • ḥari's avatar
      ḥari
      Frequent Contributor
      Here if I used worksheet("sheet1")
      It throws worksheet is not a function
      • AlexKaras's avatar
        AlexKaras
        Champion Level 3

        Hi,

         

        worksheet is not a function

        Reference provided by rraghvani is for Excel VBA. When scripting from within Excel, Excel provides VBA engine with the reference to itself. Your approach assumes Excel access via pure COM and in this case you first must get a reference to Excel itself and then proceed with its object model.

        However, I would suggest you to consider Excel object provided by TestComplete (https://support.smartbear.com/testcomplete/docs/reference/program-objects/excel/index.html).

         

    • ḥari's avatar
      ḥari
      Frequent Contributor
      WorkSheets("sheet1") and WorkSheets("sheet1"). Activate both tried with correct spell only
  • rraghvani's avatar
    rraghvani
    Champion Level 3

    If you do an internet search, there will be plenty of examples on how to select a worksheet by name

    • ḥari's avatar
      ḥari
      Frequent Contributor

      Excel via COM is executing fine till now, but that previous things still facing the same issue. For that excel internal error raised a ticket in smartbear. 

    • ḥari's avatar
      ḥari
      Frequent Contributor
      Yes, it's only happening in my machine
    • ḥari's avatar
      ḥari
      Frequent Contributor
      I don't have that I think so, but how come previously it's executed. Anyway i will install Microsoft access database engine also.
    • ḥari's avatar
      ḥari
      Frequent Contributor
      Yeah, you shared this link already, and I have requested on that time itself, sorry I forgot previously
      • ḥari's avatar
        ḥari
        Frequent Contributor
        rraghvani that system requirements also installed in my machine I confirmed with service team but still issue is there