2
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by cguan_77
1

I presume you mean an Excel Workbook/Worksheet. As far as I know you have to open it first but you can do that easily with the following function

Private Function GetWorkSheetNames(ByVal ExcelFile As String) As String()

    Dim names As String = ""
    Dim xls As New Excel.Application
    xls.Workbooks.Open(ExcelFile)

    For Each sheet As Excel.Worksheet In xls.ActiveWorkbook.Worksheets
        names = names & vbCr & sheet.Name
    Next

    xls.Quit()

    Return names.Substring(1).Split(vbCr)

End Function
Votes + Comments
Thanks.
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.