Found a snippet of code in VB (not VBA) that does just what i need. But, i think i need a reference for these types to work. Do you know what reference i need to add (using VBA project, Excel 2010)? (OR, if i have to browse, to what DLL). In the dialog, the only one that looked like a 'maybe' was one that just said "system" but that does not do it. Thanks if you know the answer to this. Here is the code by the way.
Thanks,
tom
Sub test_path()
Dim testFile As System.IO.FileInfo
testFile = My.Computer.FileSystem.GetFileInfo("C:\TestFolder1\test1.txt")
Dim folderPath As String = testFile.DirectoryName
MsgBox (folderPath)
Dim fileName As String = testFile.Name
MsgBox (fileName)
End Sub
Thanks,
tom
Sub test_path()
Dim testFile As System.IO.FileInfo
testFile = My.Computer.FileSystem.GetFileInfo("C:\TestFolder1\test1.txt")
Dim folderPath As String = testFile.DirectoryName
MsgBox (folderPath)
Dim fileName As String = testFile.Name
MsgBox (fileName)
End Sub