Ask Your Question
0

Merge cells in the range (excelpy)

asked 2023-08-03 21:39:18 -0600

Jimmy gravatar image

updated 2023-08-04 10:17:25 -0600

perolofl gravatar image

I've tried to merge cells in the range in excel using python (PSS/E,python ,API). But It shows errors.

There's something I should import? or my code has something wrong? Thanks for reading my question.

My code:

x1=excelpy.workbook(r'D:\python_test\origin','test_1')

x1.show()

x1.set_active_sheet('test_1')

x1.merge(('b1','d1'),'test_1')

Error:

Traceback (most recent call last):

File "D:\pythontest\automationtest_14.py", line 12, in <module>

x1.merge(('b1','d1'),'test_1')

File ".\excelpy.py", line 621, in merge

File ".\excelpy.py", line 1185, in activerange

ValueError: need more than 2 values to unpack

Thanks for reading my question.

edit retag flag offensive close merge delete

1 answer

Sort by » oldest newest most voted
1

answered 2023-08-04 10:14:16 -0600

perolofl gravatar image

updated 2023-08-04 10:16:31 -0600

It works for me when entering the range as follows:

x1.merge((1,'b',1,'d'),'test_1')
edit flag offensive delete link more

Comments

It works. Thank you soo much.

Jimmy gravatar imageJimmy ( 2023-08-06 19:53:48 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: 2023-08-03 21:39:18 -0600

Seen: 215 times

Last updated: Aug 04 '23