I have a string with a sourcefile path and another string with a destfile path, both pointing to Excel workbooks.
I want to take the first sheet of the sourcefile and copy it as a new tab to the destfile (doesn't matter where in the destfile), then save it.
Couldn't find an easy way in xlrd
or xlwt
or xlutils
to do this. Am I missing something?
Solution 1
A Python-only solution using the
openpyxl
package. Only data values will be copied.Solution 2
A solution using an Excel application to do the actual copying. Data values, formatting and everything else in the sheet is copied.
You could also try xlwings.
This might help if you're not opposed to using Pandas
Hope it helps