I'm using pywin32 for Excel.
I just realized that there's a bug in following code.
import win32com.client
xl = win32com.client.Dispatch("Excel.Application")
wb = xl.Workbooks.Add()
ws = xb.Sheets.Add(After=wb.Sheets(1))
Then the new sheet has to be added after first sheet, but it was added before the first sheet.
It works in the VBA in Excel, but only pywin32.
I think there's a bug during makepy the "Office 16.0 Object Library".
Other options such as Before works, but not After.
After using gencache.EnsureDispatch, it was solved by generating Excel 16.0 Object Library.
Is using "gencache.EnsureDispatch" always essential for the first time?