I am working on an excel2007 plugin in VSTO and use VB to encode it. One of the elements in the plugin is a button, clicking on which should give a call to the python program, which will add some data to the current worksheet. I would like to know 1 How can I call a python function from VBA code 2 to pass the active workbook to this code?
you can use PyXLLto call the python function from Excel either as a worksheet function or as a macro that you can call from VBA. If you look at the documents xl_macroon the PyXLL website , you will find an example of how to do this.
PyXLL
xl_macro
You might also want to consider integrating Python and Excel through COM, as this has sufficient flexibility. See Managing Excel with Python on Windows .
For the Python add-in, loaded directly into Excel, I also posted a simple implementation at http://www.bnikolic.co.uk/expy/expy.html , which is free and source code.
Source: https://habr.com/ru/post/1754219/More articles:Pkcs # 11 memory error - what could be common causes? - memory-leaksstd :: tr1 :: function :: target and co- / contravarity - c ++Is there anyway the conversion of a C # function to a sql server stored procedure? - c #HSM - cryptocurrencies - sessions - timeout - cryptographyCalculate the repeater elements that are in the user control and display it in the literal format that is on the page? - eventsПрименить стиль из поля базы данных в WPF - wpfClose if there are no active threads, or if they are active, and then wait for completion and closing - multithreadingHow to find out all installed fonts on a user computer? - javascriptSetWindowsHookEx с WH_MOUSE_LL замедляет работу мыши в течение нескольких секунд - c#Переносимое создание файлов в файлах - cross-platformAll Articles