copy and paste excel data to word using python

2,166 views
Skip to first unread message

barry jb

unread,
Jul 14, 2017, 10:49:32 AM7/14/17
to python-excel
I want to learn Python.  I have an administration task that most people have said I should use VBA to complete.  I want to learn Python so I am going to do this task with Python.  There are some other tasks down the line that VBA will not be able to do making it a better decision for me to learn Python in the first instance.

The task is to copy information from cells in an excel spreadsheet and paste it into a word document (e.g. Name, age, dob, address).  There are about 100 different cells that I will have to read data from the excel spreadsheet and paste into sentences / paragraphs / tables in word.  I have heard of python doc-x and openpyxl.  Are these the advisable packages to use for this task?  Will they enable me to copy from excel and paste into word?  Any advice would be greatly appreciated.

Chris Wakibi

unread,
Jul 14, 2017, 11:11:52 AM7/14/17
to python...@googlegroups.com
Yes,

doc-x and openpyxl are okay. You have to learn Python first however!

On Fri, Jul 14, 2017 at 1:13 PM, barry jb <barr...@gmail.com> wrote:
I want to learn Python.  I have an administration task that most people have said I should use VBA to complete.  I want to learn Python so I am going to do this task with Python.  There are some other tasks down the line that VBA will not be able to do making it a better decision for me to learn Python in the first instance.

The task is to copy information from cells in an excel spreadsheet and paste it into a word document (e.g. Name, age, dob, address).  There are about 100 different cells that I will have to read data from the excel spreadsheet and paste into sentences / paragraphs / tables in word.  I have heard of python doc-x and openpyxl.  Are these the advisable packages to use for this task?  Will they enable me to copy from excel and paste into word?  Any advice would be greatly appreciated.

--
You received this message because you are subscribed to the Google Groups "python-excel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-excel+unsubscribe@googlegroups.com.
To post to this group, send email to python...@googlegroups.com.
Visit this group at https://groups.google.com/group/python-excel.
For more options, visit https://groups.google.com/d/optout.



--

Kind Regards
Chris

I love what I do, and I know my worth...

barry jb

unread,
Jul 15, 2017, 5:19:44 AM7/15/17
to python-excel
Thanks for the reply :)
Just ok? Hmmm.  I thought they may be good at working on one or the other Excel - openpyxl and Word - python doc-x but I wasn't sure if openpyxl could work with word or if doc-x could work with excel. 

Chris Wakibi

unread,
Jul 15, 2017, 11:51:36 AM7/15/17
to python...@googlegroups.com
Barry,

I think you want to bite more than you can swallow! Like I said earlier, kindly understand python first, then you can read about openpyxl and doc-x.

Openpyxl is used to read and write xlsx documents, while doc-x is used to read and write docx documents. 

--
You received this message because you are subscribed to the Google Groups "python-excel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-excel+unsubscribe@googlegroups.com.
To post to this group, send email to python...@googlegroups.com.
Visit this group at https://groups.google.com/group/python-excel.
For more options, visit https://groups.google.com/d/optout.



--

Kind Regards
Wakibi Christopher
Reply all
Reply to author
Forward
0 new messages