Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run-time error '1004': Cannot run the macro 'xlwings-test.xlsm!ImportPythonUDFs'. The macro may not be available in this workbook or all macros may be disabled. #331

Closed
EranBenHorin opened this issue Dec 18, 2015 · 8 comments
Labels
Milestone

Comments

@EranBenHorin
Copy link

Hi,
I get this error when I do the following:

  1. xlwings template open
  2. Save as x.xlsm if the python file is x.py - whilst making sure the two files are in the same directory.

I also enabled Trust access to the VBA project object model as I should have.

Excel version: 15.0.4779.1001 64-bit
xlwings version 0.6.2
Win 8.1.

@fzumstein
Copy link
Member

OK so can you please download and unzip the udf sample from the homepage, and check if it runs OK (change some numbers or click the button) and then click on the import button again to see if you get the same error?

Alternatively, click Alt - F8 and see if the ImportPythonUDFs appears in the list of macros, if yes, run it.

@fzumstein fzumstein added the bug label Dec 18, 2015
@EranBenHorin
Copy link
Author

It worked. Interesting..

@fzumstein
Copy link
Member

So it must have probably been an issue with the xlwings VBA module that you were using. Need to check the template if something has gone wrong there.

@fzumstein
Copy link
Member

Seems all good. I am closing this issue as I bet there was something wrong with your xlwings VBA module.

@fzumstein
Copy link
Member

In the meantime I could duplicate the issue...but haven't found the real reason yet.

@fzumstein fzumstein reopened this Dec 21, 2015
@EranBenHorin
Copy link
Author

you mean replicate / reproduce the issue?

@fzumstein
Copy link
Member

yes

On Mon, Dec 21, 2015 at 3:40 PM, EranBenHorin notifications@github.com
wrote:

you mean replicate / reproduce the issue?


Reply to this email directly or view it on GitHub
#331 (comment)
.

@fzumstein
Copy link
Member

This was caused by blanks/dashes in the filename, see also answer on StackOverflow. It is now fixed and will be available with the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants