user2539088
user2539088

Reputation: 65

Python xlwings VBA reference not loading

I want to run a python script from VBA using xlwings. I have installed the excel add-in by running

xlwings addin install

from the command prompt, however, the 'xlwings' reference is not showing up in the list of available references in my VBA project. (As a separate but perhaps connected issue, the xlwings add-in in the ribbon is only partly showing: it only shows the 'Active Workbook' and 'Advanced' subcategory.)

I am on Windows 7 Enterprise and Excel 2016

xlwings reference not showing up in the VBA references list

xlwings ribbon is not complete - there's some buttons missing

Upvotes: 1

Views: 3050

Answers (3)

zleu
zleu

Reputation: 26

I came across the same problem. However, there was a work around. Since ultimately you want the work without alerting "no xlwings moduldes", you can manually import xlwings and xlwings_udfs modules into your current workbook then it will work. Those two modules should be available on any example spreadsheet from xlwings official website.

Upvotes: 1

VBAMadeMeDoIt
VBAMadeMeDoIt

Reputation: 163

Try removing the xlwings module from the VBA project(must be empty to remove...you should only have config settings there anyways) and installing the add-in via command line(xlwings addin install). Now when you try to edit your references, first confirm the xlwings project is visible in the VBA project directory on the left, and then select your current project and try to add a reference. Xlwings should now be in that list. I managed to resolve several issues by upgrading to the latest xlwings version - the older version Anaconda came with seemed to be missing a fair amount of functionality, mainly concerning the add-in(which as far as I can tell is superior to the module.)

Upvotes: 0

Christian Fischer
Christian Fischer

Reputation: 1

I just had the same issue. xlwings seems to be in the list, if you have "VBAProject (Book1)" selected before going to Tools->References. You have to make sure that you do not have the "xlwings (xlwings.xlam)" module selected, before selecting Tools-> References.

Upvotes: 0

Related Questions