Stack Exchange
AttributeError: Origin.ApplicationSI.activeworkbook
i want to filter the third column value is 3 in an opened origin file for all worksheet in the  workbook. but it always appeared > "AttributeError: Origin.ApplicationSI.activeworkbook"
here are the codes:
import originpro as op
import win32com.client as win32
import sys
def origin_shutdown_exception_hook(exctype, value, traceback):
op.exit()
sys.__excepthook__(exctype, value, traceback)
if op and op.oext:
sys.excepthook = origin_shutdown_exception_hook
if op.oext:
op.set_show(True)
origin = win32.Dispatch('Origin.ApplicationSI')
origin_file_path = r"E:\\Desk\\Elab.opju"
origin.Execute("open " + origin_file_path)
workbook = origin.activeworkbook
worksheets = workbook.Worksheets
for worksheet in worksheets:
data_range = worksheet.Columns(3)
filter_value = 2
data_range.AutoFilter(1, filter_value)
if op.oext:

op.exit()
thank you very much!

My guess would be that Origin does not mirror the Excel object model. Tbh, not sure why this is tagged with Excel.
