13-05-21 06:43 PM
Dear BP community,
We recently have updated our Excel VBO to the most recent version available on the Blue Prism DX. A great new feature in this version is that the Open Workbook action now appears to have a timeout functionality build into the code (we hope that this will decrease the chance on warning status)!
We unfortunately seem to be unable to modify the code stage (including the new timeout functionality) in a way that it can use custom parameters, such as password or the updatelinks flag. For example adding the parameter “UpdateLinks:=0” to the code stage, results in compiler errors..
Old code example (UpdateLinks):
Dim wb as Object = GetInstance(handle).Workbooks.Open(Filename:=filename, UpdateLinks:=0)
name = wb.Name
wb.Activate()
New code attempt:
name = ExecWithTimeout(Timeout, "Open Workbook",
Function()
Dim instance = GetInstance(handle)
Dim workbooks As object = GetProperty(instance, "Workbooks")
Dim wb As Object = Invoke(workbooks, "Open", Filename:=filename, UpdateLinks:=0)
Invoke(wb, "Activate")
Return wb.Name
End Function)
Could someone please advise us on how we can modify the Open Workbook code stage in a way that we can use custom parameters but also make use of the timeout functionality?
Many thanks in advance!
13-05-21 09:29 PM
Eu fiz assim e funciona bem para mim, você pode testá-lo?
Se isso ajuda você a marcá-lo como
útil
name = ExecWithTimeout(Timeout, "Open Workbook",
Function()
Dim instance = GetInstance(handle)
Dim workbooks As object = GetProperty(instance, "Workbooks")
Dim wb As Object = Invoke(workbooks, "Open", filename)
Invoke(wb, "Activate")
Return wb.Name
End Function)
17-05-21 08:31 AM