Python Forum
Manipulating Excel with Python.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Manipulating Excel with Python.
#1
Hello,

I am new to Py. I need to write data to, read data from, and run a few VBA macros within an excel book. Would rather the book never be opened (non-graphical), but I'll take a "remote control" approach if that's what it takes. I installed Openpyxl, https://pypi.org/project/openpyxl/#files and tried to load in the complicated xlsm book, and it complained "Data Validation Extension" is not supported. I was able to read a value from a cell anyway, but not able to write a new value into a cell. And when i saved the new book, it was half the size it should be, and excel couldn't open it due to it being "corrupt".

Is there a more robust way to do this? Maybe i just need a couple load options?

I used: wb = load_workbook(filename = 'myBook.xlsm')

Thanks in advance for any help :)
Reply
#2
Try other libraries: http://www.python-excel.org/
Reply
#3
Import win32com.client will allow you to write VBA within Python. Check out sigma coding Youtube channel.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Manipulating data from a CSV EvanS1 5 2,734 Jun-12-2020, 05:59 PM
Last Post: perfringo
  manipulating two lists rancans 8 3,203 Apr-16-2020, 06:00 PM
Last Post: deanhystad
  Manipulating index value, what is wrong with this code? Emun 1 1,761 Feb-05-2020, 07:18 AM
Last Post: perfringo
  Manipulating the filename of an output script mckinneycm 4 11,904 Jan-15-2020, 07:29 PM
Last Post: mckinneycm
  Manipulating CSV Prince_Bhatia 1 1,966 Apr-25-2019, 11:55 AM
Last Post: Gribouillis
  Reading and manipulating csv Prince_Bhatia 11 5,094 Mar-14-2019, 11:40 AM
Last Post: Larz60+
  Manipulating an Excel Workbook Stanimal 4 3,010 Jan-18-2019, 11:03 PM
Last Post: Stanimal
  Manipulating Binary Data arsenal88 10 8,653 Apr-25-2017, 02:30 PM
Last Post: snippsat
  Manipulating files Python 2.7 hugobaur 6 8,457 Nov-01-2016, 12:28 PM
Last Post: hugobaur

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020