0

Hi Im trying to duplicate a workeet in excel but i cant get it to duplicate the sheet with exact same style and formatting. Im using the following command. can someone provide some guidance please?

source = ws1
target = wb.copy_worksheet(source) 
  • 1
    Have you checked this? https://stackoverflow.com/questions/44593705/how-to-copy-over-an-excel-sheet-to-another-workbook-in-python – Victor Mar 23 '22 at 17:33
  • yes it doesnt carry over the style – faraz voss Mar 23 '22 at 17:37
  • Right click on the tab and use move/copy and check the box for a copy. Always duplicates correctly including the Solver settings. – Solar Mike Mar 23 '22 at 17:42
  • This is part of an automation process, so trying to do this without opening excel – faraz voss Mar 23 '22 at 17:45
  • In the link @Victor provided there are 3 solutions. Solution 1 will only copy data only so is no good. Solution 3 using xlwings is probably the better to use. It will copy style and formatting within the same workbook, did you try that? If so what style did not copy? – moken Mar 24 '22 at 10:34

0 Answers0