Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python and excel vba coding
#1
I just want to find out, if this is possible to do, as I have tried and getting errors.

I have a excel file xlsm and and have python, html, js and CSS files.
I can send data to my excel file, but have trouble running the macros in the excel file, it gives error : Error occurred while adding borders: Method 'Range' of object '_Worksheet' failed. so I have to press ok before it does something. I did adda new surname showing at the bottom
Here is my files

I cannot add my excel file

Attached Files

.html   register.html (Size: 34.02 KB / Downloads: 80)
.py   main.py (Size: 34.75 KB / Downloads: 73)
Reply
#2
Quote:I have a excel file xlsm and and have python, html, js and CSS files.

You may need 1 more thing: a Python module to manipulate Excel files.

In Python there is a module openpyxl. This module can do a lot with Excel files. (But not everything)

Here is a link, from Mouse vs. Python, about styling Excel files with openpyxl.

There is much more information about this on the internet. I always found openpyxl very useful!
Reply
#3
The funny thing is, that openpyxl is better than all available packages for LibreOffice.

So, if I work with LibreOffice Calc, I tend to save the Documents as xlsx, because it's then for me simpler to modify the content with Python outside of LibreOffice.
Larz60+ likes this post
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
Reply


User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020
This forum uses Lukasz Tkacz MyBB addons.
Forum use Krzysztof "Supryk" Supryczynski addons.