<div dir="ltr"><div class="gmail_default" style="color:#0b5394">I've successfully used pywin32 to automate some OneNote stuff using pywin32 directly and also using onepy, but I ALWAYS have to edit the registry to "fix" the OneNote key <span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px"> </span><span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px">{0EA692EE-BB50-4E3C-AEF0-356D91732725} as described in this stackflow answer:</span></div><div class="gmail_default" style="color:#0b5394"><a href="https://stackoverflow.com/questions/16287432/python-pywin-onenote-com-onenote-application-15-cannot-automate-the-makepy-p">https://stackoverflow.com/questions/16287432/python-pywin-onenote-com-onenote-application-15-cannot-automate-the-makepy-p</a> </div><div class="gmail_default" style="color:#0b5394"><br></div><div class="gmail_default" style="color:#0b5394"><span style="font-size:0.875rem">On a fresh install of Windows 10 and Office 2019 + OneNote 2016, the registry looks like the one in the stackoverflow question. </span></div><div class="gmail_default" style="color:#0b5394"><span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px"><br></span></div><div class="gmail_default" style="color:#0b5394"><span style="color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;font-size:15px">From time to time, I am on a machine where I don't have admin and I just can't automate OneNote. Is this a limitation of win32/COM or a limitation of pywin32? I seem to be able to use automation from powershell as a non-admin, so I'm not understanding what the problem with makepy is. Also, I noticed makepy does successfully generate a static proxy .py file, but when I try to create a onenote object with </span><span class="gmail-pln" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">win32com</span><span class="gmail-pun" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">.</span><span class="gmail-pln" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">client</span><span class="gmail-pun" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">.</span><span class="gmail-pln" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">gencache</span><span class="gmail-pun" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">.</span><span class="gmail-typ" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit;color:rgb(43,145,175)">EnsureDispatch</span><span class="gmail-pun" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">(</span><span class="gmail-str" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">'OneNote.Application'), it fails with the typical makepy error message "</span><span class="gmail-pln" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">COM object can </span><span class="gmail-kwd" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit">not</span><span class="gmail-pln" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit"> automate the makepy process". From what I can tell, powershell is creating a runtime wrapper in a similar way as pywin32, so it seems like this should be possible, but I don't have enough experience with python or COM to figure this out. Google is no help because every answer says "edit the registry". Is that the only answer?</span></div><div class="gmail_default" style="color:#0b5394"><span class="gmail-pln" style="font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;color:rgb(36,39,41);font-size:13px;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;vertical-align:baseline;box-sizing:inherit"></span></div></div>