First time here? We are a friendly community of Power Systems Engineers. Check out the FAQ!

Ask Your Question
0

Merge cells in the range (excelpy)

asked Aug 4 '3

Jimmy gravatar image

updated Aug 4 '3

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.

1 answer

Sort by » oldest newest most voted
1

answered Aug 4 '3

perolofl gravatar image

updated Aug 4 '3

It works for me when entering the range as follows:

x1.merge((1,'b',1,'d'),'test_1')
link

Comments

It works. Thank you soo much.

Jimmy gravatar imageJimmy (Aug 7 '3)

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.
Want to format code in your answer? Here is a one minute demo on Youtube

Add Answer

[hide preview]

Question Tools

1 follower

Stats

Asked: Aug 4 '3

Seen: 219 times

Last updated: Aug 04 '23