Menu

Error importing UDFs

Eric
2014-08-26
2014-08-26
  • Eric

    Eric - 2014-08-26

    Hi Eric,
    Using 2.0.4 (and previous version) I have UDFs working fine in one xlsm file. The addin is in the same directory as the xlsm file and the xlpython directory is a subdirectory. I created a second xlsm file in the same directory, run the addin, run Setup ExcelPython but when I try to run Import Python UDFs I get an error: "Cannot run the macro 'Test sheet.xlsm!Py'. The macro may not be available in this workbook or all macros may be disabled."

    The error occurs in Sub ImportPythonUDFs(control As IRibbonControl), Set Py = Application.Run(wb.name + "!Py")

    I'm drawing a blank on how I might have configured the first sheet (it is the one I have been playing with all along) that makes it different than the new one. Any ideas?

    Thanks,
    Eric

     
    • Eric Reynolds

      Eric Reynolds - 2014-08-26

      I see... it is indeed a strange error all I can think of is maybe you
      accidentally did not click "enable macros" if you reopened the second sheet.
      Actually another idea might be because there is a space in the name, does
      it still fail if you change the line to:

       Set Py = Application.Run("'" + wb.name + "'!Py")
      

      ?

      Eric
      On 26 Aug 2014 08:34, "Eric" earnst@users.sf.net wrote:

      Hi Eric,
      Using 2.0.4 (and previous version) I have UDFs working fine in one xlsm
      file. The addin is in the same directory as the xlsm file and the xlpython
      directory is a subdirectory. I created a second xlsm file in the same
      directory, run the addin, run Setup ExcelPython but when I try to run
      Import Python UDFs I get an error: "Cannot run the macro 'Test
      sheet.xlsm!Py'. The macro may not be available in this workbook or all
      macros may be disabled."

      The error occurs in Sub ImportPythonUDFs(control As IRibbonControl), Set
      Py = Application.Run(wb.name + "!Py")

      I'm drawing a blank on how I might have configured the first sheet (it is
      the one I have been playing with all along) that makes it different than
      the new one. Any ideas?

      Thanks,
      Eric


      Error importing UDFs
      https://sourceforge.net/p/excelpython/discussion/general/thread/deb38c8c/?limit=25#8fa7


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/excelpython/discussion/general/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       
  • Eric

    Eric - 2014-08-26

    Hi Eric,
    Doh... Just noticed that when I run Setup ExcelPython, a python file with the same name as the workbook is created. When I created the second workbook, I had already created a python file and kept trying to use it, didn't notice the new python file that was created (it is a pretty full directory...).

    I'm trying this at work where I have a virgin setup and now it works if use the right python file.

    Went back and looked at the tutorial and of course you mention the creation of the python file... I'll add a github issue to suggest that the wording be tweaked for RFTM people like me :)

    Thanks,
    Eric

     

Log in to post a comment.