[python-win32] Question win32com.client.Dispatch

Steven Manross steven at manross.net
Tue Jul 11 14:45:20 EDT 2023


When building your “AutoCad.Application” object, it looks like 2007 is the default object…

In your computer’s registry directly under HKEY_CLASSES_ROOT you should be able to find a Key (FOLDER icon) that matches that name…  as well, IF AutoCAD has different versions installed , you should be able to see “AutoCad.Application.#######” as well, which should be the COM Object name for the specific version you are looking for.

While I don’t have AutoCad installed, Microsoft Excel is an application that goes about this the same way…

If I had 2+ versions of Excel installed, I would send “Excel.Application.16” to work with for my currently installed version of Office 2019.

I hope this helps.

Steven
From: python-win32 <python-win32-bounces+steven=manross.net at python.org> On Behalf Of Mateo Gomez Montoya
Sent: Tuesday, July 11, 2023 10:20 AM
To: python-win32 at python.org
Subject: [python-win32] Question win32com.client.Dispatch

Hello,

I'm trying to use the command of win32com.client.Dispatch("AutoCAD.Application") and on the computer that I'm working with there are two versions of AutoCAD one from 2007 and another from 2021. I want to use a program that I created with the most recent version but when I run my code it automatically opens up AutoCAD2007. How can I create a dispatch that will run the most recent version of AutoCAD no matter the  computer?

P.S I don't want to uninstall the 2007 version since it runs some of my older programs.

Thank you
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/python-win32/attachments/20230711/df191202/attachment.html>


More information about the python-win32 mailing list