As the title suggested, I've tried to get the last row so I can determine the end of the range I need to copy for pasting into Outlook. I had to use win32com because it will allow me to pull the data from an opened Excel book while Pandas or openxyl doesn't allow me to do that. Below is the snippet of code I tried to do.
I did try to use sheet.max_row or even len(sheet['G') to get last row but it doesn't allow enumeration apparently.
import os
import win32com.client as client
from PIL import ImageGrab
from datetime import date
from openpyxl import load_workbook
(...)
excel = client.GetActiveObject('Excel.Application')
wb = excel.Workbooks('Test Work')
sheet = wb.Sheets['PIVOT TABLE']
loc = str(sheet.Range('B5'))
locEmail = loc_EmailName(loc.split(',')[0])
copyrange = sheet.Range('A4:G11')
copyrange.CopyPicture(Appearance=1, Format=2)
(...)