Im trying to read email and download the attachment to my own folder using win32com module in Python, I stopped at getting the attachment object:
from win32c
Just to update, I have solved this issue by claiming both dir and the file name itself in SaveAsFile:
att.SaveAsFile(os.getcwd() + '\\new.xlsx')
It is not like most threads I've seen here saying that you only need to put path in it. Actually both path and file name are needed.
Also, weirdly, you have to put os.getcwd() here since Python wouldn't recognize current running dir - in R, after we set working dir with getwd(), we are able to write to any file at this location.