Cy Bu
Cy Bu

Reputation: 1437

xlwings' RunPython fails on MAC

    MAC 10.12.5  
    Excel 2011 for MAC 
    xlwings.__version__ '0.11.2'
xlwings.__path__
['/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/xlwings']

Trying to do a RunPython from excel, always fails with:

Compile Error
Connot find file or library

Trying to narrow down, running the VBA code found in Function GetConfigFilePath() As String), specifically:

> mymodule = Left(ThisWorkbook.Name, (InStrRev(ThisWorkbook.Name, ".", -1, vbTextCompare) - 1))

invariably gives me a:

Compile Error
Connot find file or library

I see that the

~/Library/Containers/com.microsoft.Excel/Data/xlwings.conf

could not be found but i have no idea how to get it there, any lead please ?

Upvotes: 0

Views: 1343

Answers (1)

Felix Zumstein
Felix Zumstein

Reputation: 7070

UPDATE: v0.11.4 supports Mac Excel 2011 again, see: http://docs.xlwings.org/en/stable/whatsnew.html#v0-11-4-jul-23-2017

Make sure to check that it references the correct xlwings addin: In the VBA editor, go to Tools > References and select xlwings. Unselect those that start with MISSSING.... Make sure the correct project is selected while you do this.

original answer:

Mac Excel 2011 support hasn't quite caught up with the new add-in. The issues is that Excel 2011 doesn't show the ribbon and so the config file will not be created automatically. We will work on improving the user experience, but for now you should be able to work around it like this:

  • Create an empty xlwings.conf in the following path (you'll need to create it if you don't have Excel 2016 installed) ~/Library/Containers/com.microsoft.Excel/Data

  • Edit it following the instructions, if you want to set global settings that deviate from the defaults: http://docs.xlwings.org/en/stable/addin.html#config-file

  • Alternatively, skip the 2 steps above and include a xlwings.conf sheet as created automatically by xlwings quickstart <projectname>, see: http://docs.xlwings.org/en/stable/addin.html#workbook-settings (you need to use the addin from >= 0.11.3 though as there was a bug in the earlier versions.

Upvotes: 1

Related Questions