Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow EnumTlbs to work with keys only under {lcid}\win64 (i.e. don't have {lcid}\win32 too)? #1345

Open
matt-hoskins opened this issue May 21, 2019 · 2 comments

Comments

@matt-hoskins
Copy link

Working with 64-bit Office 2016 (with 64-bit Python) I found that makepy doesn't seem to find the application object libraries by name:

makepy.py -d "Microsoft Word 16.0 Object Library" Could not locate a type library matching 'Microsoft Word 16.0 Object Library'

If I run makepy.py without arguments to display the UI it's not on the list either. However looking in an Office app's VBA ui it is listed.

If I do:
makepy.py -d "Word.Application"

... then that does find Word.Application.

Searching for similar cases I found this on stackoverflow:
https://stackoverflow.com/questions/13121529/python-makepy-with-office-2013-office-15

I don't know if it's a deliberate decision for there to be "key4 = win32api.RegOpenKey(key3, "%s\win32" % (lcid,))" but then no check under lcid\win64 if that fails (where python is 64-bit), or it's just an oversight as no-one's raised it as an issue!

@evdelen
Copy link

evdelen commented Sep 11, 2019

I might be having this issue too, although my attempts to use the resolution method described here fails.

I'm running the 32-bit version of Python3 but it does not enumerate all applications installed on my system. I'm attempting to generate constants for PowerPoint but trying both "PowerPoint.Application" and "Microsoft PowerPoint 16.0 Object Library" when I run makepy.py from command line and manually scanning the GUI do not display Microsoft PowerPoint.

The CLSID for PowerPoint is {91493440-5A91-11CF-8700-00AA0060263B} and I can see a folder created within C:\Users<USER>\AppData\Local\Temp\gen_py\3.7 with that CLSID.

Has it been confirmed that this is an issue of 32 and 64-bits not playing nice?

@matt-hoskins
Copy link
Author

I might be having this issue too, although my attempts to use the resolution method described here fails.

evdelen - an alternative which I found works is to call makepy directly against the sources of COM information directly (basically bypass the step makepy performs of finding the source of information). Under 64-bit Office 2016 this is the set of commands I used to run makepy for Word, Excel, Powerpoint and some shared stuff:

python -m win32com.client.makepy "C:\Program Files\Microsoft Office\Root\Office16\MSWORD.OLB"
python -m win32com.client.makepy "C:\Program Files\Microsoft Office\Root\Office16\excel.exe"
python -m win32com.client.makepy "C:\Program Files\Microsoft Office\Root\Office16\MSPPT.OLB"
python -m win32com.client.makepy "C:\Program Files\Microsoft Office\root\VFS\ProgramFilesCommonX86\Microsoft Shared\Office16\MSO.DLL"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants