This may be a simple task but for the life of me I cannot find a solution. I have an excel document that has a table. The Columns in this table all have autofilters applied. All I want to do is to be able to select all the entries in that autofilter (for the 9th column) and store it in an array. I'm using Win32Com.
import win32com.client as win32
working_dir = 'C:\\invoice\\'
save_dir = 'C:\\test\\'
xl = win32.gencache.EnsureDispatch("Excel.Application")
xl.Visible = True
template_wb = xl.Workbooks.Open(working_dir + 'Settlement report V6-EMPLATE.xlsm')
#Worksheets
orgdata_ws = template_wb.Sheets('Organization Data')
masterdata_ws = template_wb.Sheets('Master Data')
#I want to access the autofilter in column 9 and simply get the contents in the autofilter list and put them in the array
filtercontents = []
thefilter = orgdata_ws.Columns(9).Autofilter
for i in thefilter:
filtercontents.append(i) ?????????