YasserKhalil
Well-Known Member
Hello everyone
I have this code for Mr. Jindon that grabs sheet names from closed workbook
I need to be able to select more files at the same time or specific folder that contains my files ..then extract all the sheet names from these files
At the same moment I need to excluded specific sheets from extraction process for example "Report" sheet and "Gooh" sheet
Hope it is clear
I have this code for Mr. Jindon that grabs sheet names from closed workbook
Code:
Sub Jindon()
Dim fn As String, rs As Object, a() As String, N As Long, Temp As String
fn = Application.GetOpenFilename("ExcelFiles,*.xls*")
If fn = "False" Then Exit Sub
With CreateObject("ADODB.Connection")
.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & fn & ";" & "Extended Properties='Excel 12.0'"
Set rs = .OpenSchema(20, Array(Empty, Empty, Empty, "Table"))
While Not (rs.EOF)
Temp = rs("TABLE_NAME")
N = N + 1: ReDim Preserve a(1 To N)
a(N) = Left$(Temp, Len(Temp) - IIf(Temp Like "*'", 2, 1))
rs.MoveNext
Wend
rs.Close
.Close
End With
Cells(1).Resize(N).Value = Application.Transpose(a)
End Sub
I need to be able to select more files at the same time or specific folder that contains my files ..then extract all the sheet names from these files
At the same moment I need to excluded specific sheets from extraction process for example "Report" sheet and "Gooh" sheet
Hope it is clear