Ask a Question

How to copy a worksheet of a workbook to other workbook using Python

dhirendranaga
Occasional Contributor

How to copy a worksheet of a workbook to other workbook using Python

Below is the requirement to be acheived using Python(not VBScript).

-Have a MS Excel workbook with two worksheets("Input1" and "Input2").

-Need to copy a sheet(Input2) of this workbook to other workbook.

Please help

 

 

1 REPLY 1
TanyaYatskovska
Community Manager

Re: How to copy a worksheet of a workbook to other workbook using Python

Hi Dhirendranaga,

 

To accomplish your task, I guess you’ll need to work with Excel via COM. Refer to the Working With Excel Files via COM article – it contains a Python sample that you can use to get started.

Also, you need to analyze Excel COM’s documentation to learn the approach you can use to copy a sheet from one file to another one. I’ve found some sample in Stackoverflow: http://stackoverflow.com/questions/29555607/python-copying-one-work-sheet-to-another-in-excel

---------
Tanya Yatskovskaya
SmartBear Community and Education Manager


cancel
Showing results for 
Search instead for 
Did you mean: