Method
#xlwings
sht.cells.select() #Referencing all cells
#xlwings API
#sht.api.Cells.Select()
#sht.api.Range(sht.api.Cells(1,1),sht.api.Cells(sht.api.Cells.Rows.Count,sht.api.Cells. Columns.Count)).Select()
#Reference all rows
#sht.api.Rows.Select()
#Reference all columns
#sht.api.Columns.Select()
Sample Code
#Referencing All Cells
import xlwings as xw #Import the xlwings package
app=xw.App()
bk=app.books.active #Get the active workbook
sht=bk.sheets.active #Get the active worksheet
#xlwings
sht.cells.select() #Referencing all cells
#xlwings API
#sht.api.Cells.Select()
#sht.api.Range(sht.api.Cells(1,1),sht.api.Cells(sht.api.Cells.Rows.Count,sht.api.Cells. Columns.Count)).Select()
#Reference all rows
#sht.api.Rows.Select()
#Reference all columns
#sht.api.Columns.Select()
#bk.close()
#app.kill()

Leave a Reply