ericremoreynolds / excelpython

An open source, easy to use interface for calling Python code from Excel
http://ericremoreynolds.github.io/excelpython
BSD 2-Clause "Simplified" License
234 stars 58 forks source link

Purpose of @xlfunc #15

Closed DougAJ4 closed 10 years ago

DougAJ4 commented 10 years ago

I have noticed that if I leave out @xlfunc from the top of the functions in the Python code, everything seems to work the same.

Am I missing something?

ericremoreynolds commented 10 years ago

It will carry on working until the next time you click 'Import Python UDFs' :)

The attribute is necessary for ExcelPython to identify which functions to generate the VBA wrapper code for. Once the VBA wrapper has been created (see VBA module xlpython_udfs in your workbook), it will continue to work as long as it finds the Python function, even if you have changed it, but when you need to add/remove a parameter or change an option, it needs to be regenerated.

Best,

Eric.