How to copy a table from excel to word using pythonCOM

前端 未结 1 1265
刺人心
刺人心 2021-01-13 01:35

Is it possible to get the table from excel file and paste it to the word document saving its excel style? I didn\'t find adequate documentation about win32com and all its me

1条回答
  •  鱼传尺愫
    2021-01-13 02:28

    Got it! There is no need to select anything, just straight copying

    sheet.Range("A1:D20").Copy()
    doc.Content.PasteExcelTable(False,False,False)
    

    Since there is no documentation I had to try everything at random.

    0 讨论(0)
提交回复
热议问题