cancel
Showing results for 
Search instead for 
Did you mean: 

Excel_VBO

ZejunSun
Level 3
BP可以实现合并单元格的操作吗,如果可以的话 应该怎么实现,大佬们有具体的方法吗?谢谢大家!

------------------------------
Zejun Sun
------------------------------
1 BEST ANSWER

Helpful Answers

Hi

You will have to create a new action in the excel vbo and add the following code:

Dim ws As Object
 
ws = GetWorksheet(Handle, Workbook, Worksheet)
 
ws.Activate()
 
ws.Range(Range).Merge


The input parameters are Handle, Workbook, Worksheet and Range.
Hope this helps 🙂


------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------

View answer in original post

9 REPLIES 9

loganathan.s
Level 3
Yes you can do. you can use Code code for that option. 

May be you can try this.
  1.   //Merge the Cells
  2.   worksheet.Range["C6:H6"].Merge()


------------------------------
loganathan s
Project Lead Developer
HCL Technology
Asia/Kolkata
------------------------------

Hi

You will have to create a new action in the excel vbo and add the following code:

Dim ws As Object
 
ws = GetWorksheet(Handle, Workbook, Worksheet)
 
ws.Activate()
 
ws.Range(Range).Merge


The input parameters are Handle, Workbook, Worksheet and Range.
Hope this helps 🙂


------------------------------
Michael ONeil
Technical Lead developer
NTTData
Europe/London
------------------------------

Since @Michael ONeil went to the trouble of documenting a complete solution we went ahead and added it to the latest release of the VBO (v6.10.9). This is now available on the DX.

WARNING: Merging cells call result in the loss of data. Excel only keeps data from the upper-left cell. Any other data in the cell range is discarded. Keep this in mind before you use this action. 😉

Cheers,​​

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

33973.png
您好,非常感谢您的帮助,这个方法确实可以实现合并单元格,但是Excel会弹出这个窗口会导致流程终止,可以麻烦您,这个怎么处理吗,非常感谢,谢谢!


------------------------------
Zejun Sun
------------------------------

@ZejunSun,

Are you using the method specifically as @Michael ONeil  described it above, or are you using the updated VBO from the DX? In the VBO, we added the following additional line before the merge:

Application.DisplayAlerts = False

Cheers,

------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------

谢谢您的帮助,非常感谢!

------------------------------
Zejun Sun
------------------------------

我使用了@Michael ONeil的方法, 没有使用DX

------------------------------
Zejun Sun
------------------------------

DX是需要我重新安装BP吗,我刚尝试了好像还是没有找到关于合并单元格的action

------------------------------
Zejun Sun
------------------------------

@ZejunSun,

Go to the following link, sign into the DX, and then download the latest MS Excel VBO bprelease file. Once you've downloaded that, you'll need to import it into your Blue Prism instance.

https://digitalexchange.blueprism.com/dx/entry/3439/solution/ms-excel-vbo

You do NOT have to reinstall Blue Prism.

Cheers,


------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------