Using System.IO.Directory.GetFiles in VB.NET
Posted on 2010-01-12
I'm trying to convert an Excel VBA Macro to VB.NET as a windows forms.
The general idea is to copy Local copies of the files to 2 other locations (1 as Template, another as XLS)
i thought i would try something new/simpler instead of the FileSystemObject
Files = System.IO.Directory.GetFiles(FullPath, "*.xls", IO.SearchOption.AllDirectories)
But i get an error because there are hidden/protected system files somewhere in the subfolder.
A first chance exception of type 'System.UnauthorizedAccessException' occurred in mscorlib.dll
Does anyone have any ideas?
I'm using VS 2010 Beta 2