Openpyxl. Max_columns giving error
Question: I'm using openpyxl-2.4.0-b1 and Python version 34. Following is my code:

from openpyxl import load_workbook from openpyxl import Workbook

    
    
    filename= str(input('Please  enter the filename name, with the entire path and extension: '))
    wb  = load_workbook(filename)
    ws  = wb.worksheets[0]
    row_main = 1
    
    #Main Program starts here. Loop for the entire file
    print ('Col =', ws.max_column())
    while (row_main <(ws.max_row())): #Process rows for each column
        print ('ROW =', row_main)
        row_main += 1
    

It runs into an error: Traceback (most recent call last): print ('Col =',
ws.max_column()) TypeError: 'int' object is not callable

I can't use _get_ because it has been deprecated. Many thanks in advance.


Answer: As `max_column` is `property`, so just use the name to get its value:

    
    
    print('Col =', ws.max_column)
    

Also apply on `max_row`:

    
    
    while (row_main < ws.max_row):
    

