Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Hello

 

You can try following

Add in the Header of your rule

AddReference "Microsoft.Office.Interop.Excel.dll"
Imports Microsoft.Office.Interop
Imports System.Runtime.InteropServices 

 

In your rule add

Dim objApp As Excel.Application= TryCast(Marshal.GetActiveObject("Excel.Application"), Excel.Application)

If objApp IsNot Nothing Then
	Dim objBooks As Excel.Workbooks
	objBooks = objApp.Workbooks     
	     
	Dim objBook As Excel._Workbook
	For Each objBook In objBooks
		If objBook.Name= "Document-Name_With-Extension-Without_Path" Then
		'If objBook.FullName= "DocumentName_With-FullPath-and-Extension" Then 'alternative, if document name alone is not specific enough
			objBook.Close
			Exit For
		End If
	Next
End If

R. Krieg
RKW Solutions
www.rkw-solutions.com