Skip to main content
Question

VBScript in Automation Anywhere 360

  • February 25, 2025
  • 6 replies
  • 106 views

Forum|alt.badge.img+1

We are using a VBScript in Automation Anywhere 360 and using VbScript to attach multiple files into a Microsoft Word document. The script runs fine for a certain number of transactions, successfully attaching files and closing Word properly. However, after reaching a certain number of executions, Word fails to close properly.

 

Observations:
1. Word appears to close from the front end, but when checking Task Manager, WINWORD.EXE is still running in the background.
2. The attachments are saving properly, so the issue seems to occur after the file attachments, during the closing process.
3. The script freezes after multiple runs, likely because Word is stuck in the background.
4. The issue does not happen immediately, but after several executions.

6 replies

Marc Mueller
Most Valuable Pathfinder
Forum|alt.badge.img+17
  • Most Valuable Pathfinder
  • February 25, 2025

Hi ​@KushalVadgama,

have you tried this one?

 

Cheers

Marc

 

 


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • February 25, 2025

Hi ​@Marc 1985

Yes, we kill all the unwanted session once the transaction is completed or at start of the transaction 


Marc Mueller
Most Valuable Pathfinder
Forum|alt.badge.img+17
  • Most Valuable Pathfinder
  • February 25, 2025

@KushalVadgama and you can not include this in an error trap to be triggert if needed?


Marc Mueller
Most Valuable Pathfinder
Forum|alt.badge.img+17
  • Most Valuable Pathfinder
  • February 25, 2025

@KushalVadgama 

Something like this in VB Script:

Function KillAll(ProcessName)
Dim objWMIService, colProcess
Dim strComputer, strList, p
Dim i :i= 0
strComputer = "."
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcess = objWMIService.ExecQuery ("Select * from Win32_Process Where Name like '" & ProcessName & "'")
For Each p in colProcess
p.Terminate
i = i+1
Next

End Function

call KillAll("WINWORD.exe")

 


Forum|alt.badge.img+1
  • Author
  • Cadet | Tier 2
  • February 25, 2025

Thanks ​@Marc 1985 


Marc Mueller
Most Valuable Pathfinder
Forum|alt.badge.img+17
  • Most Valuable Pathfinder
  • February 25, 2025

@KushalVadgama let us know if it worked for you please… 😊