I am currently using python with the openpyxl library to move data from my program to an excel sheet. I am now trying to copy a set range to the clipboard as if I copied if from the sheet itself so that it would paste like a block (as excel does when copying a range), is there a way of doing this?
Thank you!
Update: so I installed pywin32 and I imported win32clipboard just fine. I tried to copy with that using this
win32clipboard.OpenClipboard()
win32clipboard.EmptyClipboard()
win32clipboard.SetClipboardData(17, ws['A1':'F{}'.format(i)] )
win32clipboard.CloseClipboard()
and I received the error as following;
File "C:\Users\victoriom\My Documents\LiClipse Workspace\Dot\Main.py", line 394, in CalculateFunc
win32clipboard.SetClipboardData(17, ws['A1':'F{}'.format(i)] )
TypeError: 'tuple' does not support the buffer interface
I thought that maybe it was because I was using the wrong data format so I tried all the excel type (I can provide the list if it helps but its about 30 different numbers) but everyone one gave the same error