As for the issue, you can get all paths of files in a folder by calling Directory.GetFiles. This code:
will actually get paths for XLS and XLSX files, as a three-character extension matches extensions of any length that start with those three characters.vb.net Code:
Dim filePaths = Directory.GetFiles(folderPath, "*.xls")
As for getting the sheets in a workbook, I'm not 100% sure. You can definitely do it using Excel Automation, but it would be nice to avoid that if possible. You can try the GetSchema and GetOleDbSchemaTable methods and at least one of them will probably get you the information you want. I've used it with genuine databases but never an Excel workbook so I'm not sure. I would expect at least the latter to work though.




Reply With Quote
