View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Trevor[_4_] Trevor[_4_] is offline
external usenet poster
 
Posts: 9
Default Variable File Name

We are using -

FileOpenName = Application.GetOpenFilename("Text Files
(*.txt),*.txt", 1, "Open IFCAP Text File", , False)

to prompt the user for the file to be opened. Later in our
macro we want to switch from another workbook to this
workbook, but can't figure out how to get the workbook
name as a variable from the FileOpenName variable.

The FileOpenName could be "C:\FOLDER1\FOLDER2\FNAME.xls."
It could have multiple folders and the filename can vary.
We can not see how to get the FNAME.xls extracted. We
looked at Instr but couldn't see how to use it to get what
we want.

Any ideas?