Mathieu,

my solution is:

- use makepy.py to create the object librarie for 2003 and 2010; 
- store them in files as excel2003.py, excel2010.py (--name parameter of makepy)
- use this kind of binding, check which Excel is on your computer and do conditional import

if excel_2010_is_present:
   import excel2010 as excel
else:
   import excel2003 as excel 


best wishes
Harald
2012/7/11 Mathieu BEAL <mathieu.beal@gmail.com>
Hi,

I want to create an .exe with py2exe for 2 versions of Excel.
The Excel 2003 is installed on my computer, but users have to use the Excel 2010 version.

Is there a way to create an .exe that uses the correct excel version on my computer and the correct one on the users' computers ?

############
setup(
   data_files = data_files,
  
    options = {"py2exe": {"compressed": 2,
                          "optimize": 2,
                          "includes": includes,
                          "excludes": excludes,
                          "packages": packages,
                          "dll_excludes": dll_excludes,
                          "bundle_files": 3,
                          "dist_dir": "dist",
                          "xref": False,
                          "typelibs": [('{00020813-0000-0000-C000-000000000046}',0,1,5),
                                        ('{00020813-0000-0000-C000-000000000046}',0,1,7)],
                          "skip_archive": False,
                          "ascii": False,
                           "custom_boot_script": '',
                         }
              },

    zipfile = "lib\library.zip",
    #console = [GUI2Exe_Target_1]
    windows = [GUI2Exe_Target_1]
     )

############
The console gives me the following error:
pywintypes.com_error: (-2147319779, (Bibliotheque non inscrite.' , None, None)

The first Excel CLSID works, the second doesn't . It's normal but how to include both ?

Sincerely,

Mathieu

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Py2exe-users mailing list
Py2exe-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/py2exe-users




--

GHUM GmbH
Harald Armin Massa
Spielberger Straße 49
70435 Stuttgart
0173/9409607

Amtsgericht Stuttgart, HRB 734971