简体   繁体   中英

How to add data using python from one sheet to an existing sheet in another workbook without overwriting other sheet's data?

I have an two excel files 'file1' and 'file2'. file1 has data filled in 3 sheets. I want to copy data from file2 and append it into sheet3 in file1 and save the same file. Can anyone help me do this using python?

xlwt is used to write into existing files.

Here is the similar thread to your question. . .

writing to existing workbook using xlwt

If you are using Windows, you can try PyWin32 to directly run Excel.

from win32com.client import Dispatch
xlApp = Dispatch("Excel.Application")
...

Some recipes here .

NOTE: You will need to install PyWin32 binary.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM