Python in Excel! Part 5 - Create Python cells from GitHub scripts using VBA! 🐍🤩

Опубликовано: 26 Август 2023
на канале: flexyourdata
3,398
77

Someone asked me a question earlier this week about whether we could use Python with VBA.

The answer is yes, sort of.

In this video:

1. A python cell is a Python script inside the PY spreadsheet function. Excel changes the way the cell behaves when that function is present. But it's still a function call.

2. A GitHub gist is a way to quickly share code files. We can click the 'raw' button to view the contents of the file.

3. Using the XMLHTTP60 library in VBA allows us to make a request to a web page and retrieve the contents. So, we can grab the python code from the gist and save it in a VBA variable.

4. We can then concatenate the Python code from the gist with the PY function and insert it into a cell.

5. The second parameter of the PY function tells the cell whether to display as a Python object (using 1 as the 2nd argument) or an Excel value (using 0 as the 2nd argument).

This is a very basic example but I hope it offers food for thought, particularly for those concerned about version control of the Python in an Excel file.

What do you think about this?

Let me know in the comments below. 💬

---

If you like this, please like, share and subscribe.

#data #analytics #excel #python #dataanalytics


На этой странице сайта вы можете посмотреть видео онлайн Python in Excel! Part 5 - Create Python cells from GitHub scripts using VBA! 🐍🤩 длительностью часов минут секунд в хорошем качестве, которое загрузил пользователь flexyourdata 26 Август 2023, поделитесь ссылкой с друзьями и знакомыми, на youtube это видео уже посмотрели 3,398 раз и оно понравилось 77 зрителям. Приятного просмотра!