Quantcast
Channel: New board topics in SmartBear Community
Viewing all articles
Browse latest Browse all 20990

Excel Reading Using Python code

$
0
0

Hi,

 

I am using below code to read Excel using Python code and at end using Quit() to close the object. But even after successfull execution of code, there is one Excel.Exe process in Task Manager. Please suggest whether this is issue with my code or TestComplete with Python.

 

def loadExcel(vExcelFilePath):  

 try :

   oExcel = Sys.OleObject["Excel.Application"]

      oExcel.Workbooks.Open(vExcelFilePath)

  

      vRowCount = oExcel.ActiveSheet.UsedRange.Rows.Count

      vColumnCount = oExcel.ActiveSheet.UsedRange.Columns.Count  

 

      oExcel.Quit()

     

   except Exception as e:

    Log.Warning("Exception caught in loadExcel() : ",str(e))

        oExcel.Quit()

 

Tried oExcel.Workbook.Close() before Quit(), but says no such property/method supported for object.

 


Viewing all articles
Browse latest Browse all 20990

Trending Articles