Skip to sidebar Skip to content
Ipercube Technical
Jack of all trades, master of none
Date: Time: - Stardate:
Welcome, Log in by clicking  Here!
SS64
MDN
Stack
Code
GitHub
Wiki
Convert
V Studio
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions
Ipercube Technical
  • Home
  • VB Functions
    • Access Functions
    • Assembly Info
    • Color/Image Functions
    • Data Table Functions
    • Email Functions
    • Active Directory Functions
    • LDAP Functions
    • Excel Functions
    • Logging Functions
    • Source Code Retrieval
    • String Functions
    • Sql Functions
    • Object Utilities Functions
    • System and Utilities
    • Utility Forms
  • VB Classes
    • Environment Variables Helper
  • ABAP
    • ABAP Reports
    • ABAP HTTP Functions

Workbook Access – Is Excel File Opened

Checks whether a specific Excel file is currently open in the given Excel.Application instance.

This function checks if a workbook with the same file name (not full path) is currently open in the given Excel instance by attempting to access it through the Workbooks collection. If access throws an exception, the file is assumed not to be open.

VB
    Public Function xlIsExcelFileOpened(CallingApp As Excel.Application, 
                                        FileName As String) As Boolean

        Try
            Dim Wbk As Workbook = CallingApp.Workbooks(Path.GetFileName(FileName))
            Wbk = Nothing
            Return True
        Catch ex As Exception
            Return False
        End Try

    End Function

Posted by ipercube


© 2026 Ipercube Design