# PyWin32 'None' variable



## artmansoft (Feb 16, 2009)

We have a Visual Basic script that communicates with an application through com. We like to translate it to Python and use win32com.client instead. We have everything working, except for the use of "Nothing" in the VB script for a couple of its function calls. What is the replacement of "Nothing" in Python? Note that the generic "None" does not work. 

Thanks in advance,
Artman


----------



## shuuhen (Sep 4, 2004)

Well, I assume "Nothing" in VB is close to NULL in C. For Python, it is None. I'd have to see the code to have an idea why it is failing. Errors also help, if available. I don't deal with Python code very often and avoid VB completely, so I'm not sure what strange quirks could be involved (especially from VB).

Python built-in constants: http://docs.python.org/library/constants.html?highlight=none#None


----------



## artmansoft (Feb 16, 2009)

I even tested pythoncom.Empty but it did not work. It issues the following error when I am passing it instead of VB Nothing to AccessSelection() function:

File "<COMObject <unknown>>", line 2, in AccessSelections
pywintypes.com_error: (-2147352571, 'Type mismatch.', None, 2) 

What do you think I should do?


----------

