# Has anybody gotten win32com to work in python for revit

**URL:** <https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943>\
**Category:** Developers\
**Tags:** python\
**Created:** [September 21, 2023, 4:15pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943 "2023-09-21T16:15:42Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![richard.bruceTKMW9](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@richard.bruceTKMW9](https://forum.dynamobim.com/u/richard.bruceTKMW9)\
**Post date:** [September 21, 2023, 4:15pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/1 "2023-09-21T16:15:42Z")

</div>

I have been able to install the pypiwin32 on my pc in vs code but am having some issues moving it over to our network. The specific error i am getting is "Warning: ImportError : DLL load failed while importing \_win32sysloader: The specified module could not be found. "

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [September 21, 2023, 7:16pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/2 "2023-09-21T19:16:43Z")

</div>

Hello @richard.bruceTKMW9

this has a relationship with DynamoBIM ?

---

<div class="post-metadata">

**Author:** ![richard.bruceTKMW9](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@richard.bruceTKMW9](https://forum.dynamobim.com/u/richard.bruceTKMW9)\
**Post date:** [September 21, 2023, 7:28pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/3 "2023-09-21T19:28:19Z")

</div>

Yes I am trying to get it to work in dynamo in revit.

---

<div class="post-metadata">

**Author:** ![c.poupin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/c.poupin/32/89152_2.png) [@c.poupin](https://forum.dynamobim.com/u/c.poupin)\
**Post date:** [September 22, 2023, 5:38pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/4 "2023-09-22T17:38:18Z")

</div>

Maybe you can try with `comtypes`

 ![image](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/c/4/c41f971a024677d622aedd4137523240252978f8.png)

```auto

import sys
import clr

clr.AddReference('Python.Included')
import Python.Included as pyInc
path_py3_lib = pyInc.Installer.EmbeddedPythonHome
sys.path.append(path_py3_lib + r'\Lib\site-packages')

from comtypes.client import CreateObject
from comtypes.gen.Excel import xlRangeValueDefault

xl = CreateObject("Excel.Application")
xl.Visible = True
xl.Workbooks.Add()
sh = xl.Workbooks[1].Sheets["Feuil1"]
# write value
sh.Cells.Item[1,1].Value[()] = "Hello World!"
# read value
test = sh.Cells.Item[1,1].Value()
print(test)

OUT = test

```

help link to install python package in DynamoBim

> **[Customizing Dynamo's Python 3 installation](https://github.com/DynamoDS/Dynamo/wiki/Customizing-Dynamo's-Python-3-installation)**
>
> Open Source Graphical Programming for Design. Contribute to DynamoDS/Dynamo development by creating an account on GitHub.

> **[\[Dynamo += Python\] Installation automatisé de Package CPython3](https://voltadynabim.blogspot.com/2022/03/dynamo-python-installation-automatise.html)**
>
> Blog sur le BIM, du Python et d'la Dynamo appliqués aux électrons

---

<div class="post-metadata">

**Author:** ![richard.bruceTKMW9](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@richard.bruceTKMW9](https://forum.dynamobim.com/u/richard.bruceTKMW9)\
**Post date:** [September 22, 2023, 6:18pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/5 "2023-09-22T18:18:10Z")

</div>

So that is part of the problem I am trying to get this to work on a network drive not from my c drive, or are you telling me I have to install it on everybody’s Pc in that location.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [September 22, 2023, 7:51pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/6 "2023-09-22T19:51:44Z")

</div>

> [@richard.bruceTKMW9](#):
>
> I have to install it on everybody’s Pc

This is likely going to be a requirement as it’s a standard practice to block execution of remote code, and while you may be able to get such setups working today for is unlikely to stay as such for long. Packaging the node in question and deploying the relevant libraries it requires is likely going to be a must in the long run.

---

<div class="post-metadata">

**Author:** ![richard.bruceTKMW9](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@richard.bruceTKMW9](https://forum.dynamobim.com/u/richard.bruceTKMW9)\
**Post date:** [September 22, 2023, 8:31pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/7 "2023-09-22T20:31:07Z")

</div>

Thank you both I think the comtypes is going to work for me, I just need to figure out how to send information to an outlook email.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [September 22, 2023, 8:50pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/8 "2023-09-22T20:50:42Z")

</div>

Hearing that you are after that, this may be relevant to your interests:

[![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/8/6/86a513a59bb00815d88758d776e61ea7c28ceab3.jpeg "Sending emails using Dynamo!") ](https://www.youtube.com/watch?v=_ArjhhVB_Sw)

---

<div class="post-metadata">

**Author:** ![richard.bruceTKMW9](https://avatars.discourse-cdn.com/v4/letter/r/50afbb/32.png) [@richard.bruceTKMW9](https://forum.dynamobim.com/u/richard.bruceTKMW9)\
**Post date:** [September 22, 2023, 9:04pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/9 "2023-09-22T21:04:10Z")

</div>

Jacob  
thank you but i have actually already watched that video it is close to what I want. I need outlook to actually open a new message and transfer data over to it.

---

<div class="post-metadata">

**Author:** ![jacob.small](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/jacob.small/32/161030_2.png) [@jacob.small](https://forum.dynamobim.com/u/jacob.small)\
**Post date:** [September 22, 2023, 9:31pm UTC](https://forum.dynamobim.com/t/has-anybody-gotten-win32com-to-work-in-python-for-revit/93943/10 "2023-09-22T21:31:33Z")

</div>

You want the UI to allow users to edit the message?
