Replace VBA's object "Empty" with pythoncom.Missing doesn't work
Question: Few years ago I wrote script in Python to automate few tedious processes that
I was doing in SolidWorks_2012. I was running that script on Win7 32 bit with
python 27 32 bit and SolidWorks_2012 32 bit.

Now, I faced exactly the same problem and I tried to use old script but on
**OpenDoc6** (and on others functions, where **values pass by ref**) it raises
exception:

    
    
    "Objects of type 'PyOleMissing' can not be converted to a COM VARIANT"
    

Here is some sample that I can't make to work:

    
    
    import win32com.client as win32
    import pythoncom
    
    sw = win32.Dispatch('SldWorks.Application')
    path_to_file = "some_path"
    sw_asm = sw.OpenDoc6(path_to_file, 2, 1, "", pythoncom.Missing, pythoncom.Missing)
    

Here is some specification of this function from docs for VBA:

    
    
    Function OpenDoc6( _
       ByVal FileName As System.String, _
       ByVal Type As System.Integer, _
       ByVal Options As System.Integer, _
       ByVal Configuration As System.String, _
       ByRef Errors As System.Integer, _
       ByRef Warnings As System.Integer _
    ) As ModelDoc2
    

As you can see two latest are passing by references.

Also [here](http://stackoverflow.com/questions/19454804/pointer-callout-for-
selectbyid2) is the same issue without any solution. And just in case this may
be important, now I'm running win 8 64, python 27 32/64 and SolidWorks 2014
64.

**Thank you in advance!**


Answer: just insert empty variables. Had the same error in VBA where you had to pass
variables declared as LONG or it would not work.

