cancel
Showing results for 
Search instead for 
Did you mean: 

How to break links in Excel workbook by BP?

立晨姚
Level 3
20660.png


------------------------------
立晨 姚
------------------------------
3 REPLIES 3

steven.boggs
Staff
Staff
From the question asked in the subject line of this thread and the screenshot posted, it isn't immediately clear what you're looking for help with here. Could you please clarify what it is you're looking to do in Blue Prism with regard to links in an Excel workbook?

------------------------------
Steve Boggs
Senior Product Support Engineer
Blue Prism
Austin, TX
------------------------------

The UI should work for this, but if you can't get UI to work, then send keys:

Alt
a
k
Alt b
Alt b

Set for 100ms between keystrokes so it has time to move through the menu, screens, popup warnings, etc.

------------------------------
Michael Annis
------------------------------

Hi

Yes you can break the links in an excel file but you would need to create a new code action in the excel vbo. If you create a new action and add in the below code it should break the link you have requested. The inputs are Handle, WorkBook and LinkToBreak. You need to pass in the link you want to break as it appears in the excel file e.g. if the link shows as C:\mydocs\mytestfile.xlsx then the link you pass as an input must match it exactly. I havent tested the code below but I think this is how it should look and hopefully it works for you.

Dim wb As Object
Dim excel As Object

Try

wb = GetWorkbook(Handle, Workbook)
excel = wb.Application
excel.ActiveWorkbook.BreakLink(LinkToBreak,1)

Success = True

Catch e As Exception
Success = False
Message = e.Message
Finally
wb = Nothing
End Try

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