Ecohouse wrote:
On Oct 22, 4:29 pm, Ecohouse <ecovinda...@yahoo.comwrote:
>>I know how to use the File Dialog control but I'm not sure how to
actually open the file that is selected. Here's my code:
'Create a FileDialog object as a File Picker dialog box.
Set fd = Application.FileDialog(msoFileDialogOpen)
'msoFileDialogFilePicker
' Select Excel file for import
With fd
If .Show = True Then
.AllowMultiSelect = False
I don't API that's why I was using the File Dialog. Do you know what
I need to do to get this working?
> 'Find the selected file name
For Each varFile In .SelectedItems
strFile = varFile
Next
Else
MsgBox "Select a file."
GoTo FindFile_Exit
End If
End With
So once I have the name of the file what do I need to do? Thanks in
advance for the help.
File/Open (selects file)
http://www.mvps.org/access/api/api0001.htm
EX:
'creates a series of file filters
strFilter = ahtAddFilterItem(strFilter, _
"Microsoft Access Files (*.mdb)", "*.mdb")
strFilter = ahtAddFilterItem("", "Excel Files (*.xls)", "*.xls")
strFilter = ahtAddFilterItem(strFilter, _
"All Files (*.*)", "*.*")
'now get a filename
strFile = GetOpenFile(strFilter:=strFilter)
Run/open file with associated exe
http://www.mvps.org/access/api/api0018.htm
Ex:
If strFile "" THen_
var = fHandleFile(strFile, 3) '3 opens maximized