Author Topic: Portability of PyXLL  (Read 1680 times)

ScottB

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Portability of PyXLL
« on: February 12, 2014, 02:31:44 AM »
Hi All,

I just found out about PyXLL and excited to learn more about it.

One important question I have is how portable is the extension?

Ideally I love to be able to make Excel Functions (or Macros) in python and have the python code embedded into the excel document. Then the document could be sent to someone without PyXLL or even python and use those functions. That way I could use PyXLL as an alternative to VBA macros.

Thanks

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 615
  • Karma: +14/-1
    • View Profile
Re: Portability of PyXLL
« Reply #1 on: February 12, 2014, 11:58:38 AM »
Hi,

this is not really the intended use-case for pyxll. The end user needs to have python installed and no code is ever embedded in the spreadsheet, it is all in external python modules and so the end user needs to have access to those modules as well (either deployed as eggs or your own distribution mechanism such as putting the code on a network drive).

This is by design as having code saved in spreadsheets causes more problems than it solves when it comes to releasing updates to that code. Spreadsheets that include VBA code and get sent around can result in inconsistent behavior as changes can be made in some copies of the sheet and not in others. Keeping the code separate from the sheet itself ensures that can never happen.

If you want your code embedded in the sheet you are better off sticking with VBA.

Best regards,
Tony

ScottB

  • Newbie
  • *
  • Posts: 2
  • Karma: +0/-0
    • View Profile
Re: Portability of PyXLL
« Reply #2 on: February 13, 2014, 06:29:20 PM »
Thanks for the fast reply. Would then an end user have to have pyxll installed in addition to standard python?

If it has to be separate, it be great to be able to package it as a self-contained feature that is sent along with an excel sheet. I am a coder for the federal government and have to often make custom excel spread sheets for non-computer oriented people. They should be able to install an add in after that fact, but outside of doing a basic python install or using features outside of the python that comes with ArcGIS (which unfortunately most use that) I am limited by what I can send out.

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 615
  • Karma: +14/-1
    • View Profile
Re: Portability of PyXLL
« Reply #3 on: February 13, 2014, 06:38:57 PM »
Hi Scott,

there is a tool for packaging python files together with the xll into a single binary called pyxll-bake, but it's not freely available to download.

Email me at info at pyxll dot com and I'll send you some more details.

cheers,
Tony