Author Topic: Extension Loader question  (Read 472 times)

aavanian

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Extension Loader question
« on: November 04, 2015, 07:13:46 AM »
Hello,

I have a question regarding the Extension Loader from pyxll-utils. I got it working well but since then, it seems the 'Reload PyXLL' menu item doesn't work anymore.

As I'm not familiar with the way it works and uses the setup.py config, I am not sure if it's the expected behavior or not?

If it's as expected, is there a way (programmatically reload pyxll) to circumvent it? otherwise, I'll just keep a pyxll.cfg file for my own use that loads the modules directly and keep the extension loader for deployment/non-dev usage.

Thanks
Alex

Tony

  • Administrator
  • Hero Member
  • *****
  • Posts: 574
  • Karma: +13/-1
    • View Profile
Re: Extension Loader question
« Reply #1 on: November 24, 2015, 01:26:32 PM »
Hi Alex,

sorry it's taken a while to reply to this.

It is possible to get a notification when a reload occurs using the xl_on_reload callback (https://www.pyxll.com/docs/index.html#pyxll-callbacks). You could register a function to be called when a reload happens, and in there reload the relevant Python modules and then do a 'rebind'. Rebinding will re-register the Excel functions for the currently loaded Python functions without reloading any python modules, but the rebind macro has to be called via COM (https://www.pyxll.com/docs/index.html#developer-tools).

It may be easier to do what you suggest and just stick with the config file for development, and use the extension loader for released/deployed code. It's given me an idea to add a feature to be able to programatically register modules as needing to be reloaded when PyXLL reloads... I'll have a think about how that could work and this specific use case and incorporate it into a future version!

Best regards,
Tony

aavanian

  • Newbie
  • *
  • Posts: 18
  • Karma: +0/-0
    • View Profile
Re: Extension Loader question
« Reply #2 on: November 25, 2015, 05:39:53 PM »
Thanks for the answer, it's clear.
As I said, it's no big deal.

Alex