Hi Tim and Waldemar:

I have tried ironPython before.  I guess that is pretty straight to compile
an ironPython code into a DLL so other .NET program can call it.  I never
done it before, but I followed an example of a DLL made with C++ that later
was called from an ironPython program.  However, in order to use Matplotlib
within ironPython, this library has to be called with a CPython engine
embedded.  In fact, the guys of Resolver Systems started "The C Extensions
for IronPython Project" in order to use any CPython library with
ironPython.  But this doesn't solve my original question.  It seems that
Matplotlib (not any library out there) doesn't generate a usable image
objects for Excel.  So I think, at the end there would not be any
difference if I go for the COM server solution or the ironPython one.

I have been checking some external libriaries and APIs that integrates
Excel with Python.  Among them is "xlwings" as suggested by Waldermar.
I'll write my findings so other people reading this forums may benefit:


   - xlwings:   I think this is the earliest package and is open source.  I
   never tried, but it seems very suitable for replacing VBA for Python in
   Excel spreadsheets.  I checked if there's any easy way to bring to the
   spreadsheet images generated in the Python code , but I didn't find any.
   Therefore, the only way may be the one I found with the COM servers:  save
   an image file with python, and then load the image with VBA.


   - ExcelPython:   Also is open source, and newer than xlwings.   It seems
   to be better for writting Excel Functions (UDFs).  But still relies on VBA
   on the spreadsheet.  I don't know about importing images.


   - PyXll:  This is not an open source, and its fee is quite expensive
   ($250).  It's been around for 5 years and it works very well in all
   issues.  It manages images very well, but looking more in detail, it
   imports images through temporally files.  However, I don't have to write
   any code in VBA to do so.  It relies on PyQt to do so, and some code in
   Python is required.


   - DataNitro:  This in not open source and its fee is $99.  This is
   basically an Excel Add-In. This is the only one I tested directly.  It does
   work very good in almost everything.  It imports images beautifully.  It
   has a PyPlot wrapper called "nitroplot" that behaves exactly the same, but
   as if it were native to Excel.  There're examples of dynamic images working
   on the spreadsheet.  I have no idea how DataNitro imports images.  However,
   I found that this Add-In doesn't work on any version of Excel.  For
   example, I use a Spanish version and there are some issues very difficult
   (sometimes impossible) to fix.


The following blog makes a very interesting comparision
https://www.pyxll.com/blog/performance-comparison/   but for obvious
reasons is biased towards PyXll.

As I don't need dynamic images, I'll go through the route with COM servers
and and temporally files in order to import images.

So TIM:  Now that I know how to build COM servers, can you please give my
lights how can I make a stand alone one using py2exe?   I need to install
in computers were the clients may not even know that Python exists.

Thanks everybody for reading and writing about this topic.
Best regards,
Diego

2015-05-01 14:34 GMT-05:00 Waldemar Osuch <waldemar.os...@gmail.com>:

> This project seems to be relevant to the discussion.
> http://xlwings.org/
>
> It's Excel <-> Python integration. Maybe you do not have to start from
> scratch to achieve your goal.
>
> w/o
>
> _______________________________________________
> python-win32 mailing list
> python-win32@python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
>


-- 
Diego Vélez Torres
divele...@gmail.com
Teléfono: 098 28 57 58
Cuenca, Ecuador
_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to