Menu

Preventing refreshing when opening workbook

Eric
2014-10-09
2014-10-10
  • Eric

    Eric - 2014-10-09

    Hi,
    This is most likely just an Excel question but hopefully one folks here have faced. When I open a workbook with ExcelPython UDFs, a bunch of them fire. Since some of them involve queries and parsing results from websites it can take a while before I can edit the workbook.

    I've set the option for Workbook Calculation to manual (Options/Formulas), and under the Trust Center, External Content I've even disabled all data connections (Stackoverflow comment). I have an event macro that switches the tab to a tab with no functions when shutting down and I save it there. Despite this the worksheet usually fires a bunch of functions when it opens.

    I've traced the "usually fires" to when I start Excel and then open the workbook. The functions on the last tab that was edited fire, even if the workbook was saved on the empty tab and any edits that would cause a function to update were run (so it isn't dirty). If I close the workbook (with or without saving) and reopen it, but leave Excel running, the functions honor the manual calc option and don't fire.

    Any ideas how this behavior can be "fixed"?

    Thanks,
    Eric

     
    • Eric Reynolds

      Eric Reynolds - 2014-10-10

      I'm afraid I don't know how to fix this, it's the kind of thing that you
      would expect to just work in Excel but it never does behave as one expects.

      Ultimately, wrapped ExcelPython functions (i.e. the ones decorated with
      @xlfunc), from Excel's perspective are just VBA functions that call the
      corresponding Python code, so they should behave the same way as any other
      VBA user-defined function (what I mean is that there's special 'magic'
      behind them, as perhaps there could be with an XLL or other device).

      The only workaround I can think of is perhaps putting adding a calculate
      true/false parameter to your functions, linking it to a cell and setting
      that cell to false in the workbook's Open event. A bit ugly but at least if
      it solves the problem...

      Sorry I couldn't be of any more help,

      Eric.

       
      • Eric Reynolds

        Eric Reynolds - 2014-10-10

        Sorry I meant to say "there's NO special 'magic' behind them..."​

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.