copy & paste isolation with win32com & python

前端 未结 3 725
失恋的感觉
失恋的感觉 2021-01-14 17:08

Is there a way of using python and win32com to copy and paste such that python scripts can run in the background and not mess up the \"users\" copy and paste ability?

<
3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-14 17:48

    Instead of:

    ws.Range('a1:k%s' % row).select
    ws.Range('a1:k%s' % row).cut
    ws.Range('a7').select
    ws.paste
    

    I did:

    ws.Range("A1:K5").Copy(ws.Range("A7:K11"))
    

    according to MSDN: Excel Object Model Reference

提交回复
热议问题