R
RB Smissaert
Trying to get the first file selected when doing
Application.GetOpenFilename.
In Excel 2002 I could do:
SendKeys "{TAB 7}", False
FileNameToOpen = _
Application.GetOpenFilename(FileFilter:="Text Files (*.txt), *.txt", _
Title:="")
and that worked fine.
In Excel 2003, it only works partially in that the first file has the dotted
line around it, but doesn't actually have the focus. If I do the HOME key
manually the first file gets the focus, but doing:
SendKeys "{TAB 7}", False
SendKeys "{HOME}", False
FileNameToOpen = _
Application.GetOpenFilename(FileFilter:="Text Files (*.txt), *.txt", _
Title:="")
doesn't work. Adding SendKeys "{HOME}", False just doesn't make any
difference. Tried it with the UP, DOWN, LEFT and RIGHT keys, but that didn't
work either.
Any suggestions how to do this?
RBS
Application.GetOpenFilename.
In Excel 2002 I could do:
SendKeys "{TAB 7}", False
FileNameToOpen = _
Application.GetOpenFilename(FileFilter:="Text Files (*.txt), *.txt", _
Title:="")
and that worked fine.
In Excel 2003, it only works partially in that the first file has the dotted
line around it, but doesn't actually have the focus. If I do the HOME key
manually the first file gets the focus, but doing:
SendKeys "{TAB 7}", False
SendKeys "{HOME}", False
FileNameToOpen = _
Application.GetOpenFilename(FileFilter:="Text Files (*.txt), *.txt", _
Title:="")
doesn't work. Adding SendKeys "{HOME}", False just doesn't make any
difference. Tried it with the UP, DOWN, LEFT and RIGHT keys, but that didn't
work either.
Any suggestions how to do this?
RBS