Hi Robert,
to parse the filename, you can do this:
'~~~~~~~~~~~~~~
Dim mPath As String, mFile As String
mPath = GetOpenFile("Pick an file in the Directory for
Excel Export Path", "*.*")
If Len(mPath) > 0 Then
mFile = Dir(mPath)
mPath = Left(mPath, Len(mPath) - Len(mFile))
Me.ExportPath = mPath
End If
'~~~~~~~~~~~~~~
to make it easier to call Ken's code, I wrote a general
function -- this goes in a general module
'------------------------------ BrowseFile
Function BrowseFile( _
pTitle As String, _
Optional pFilter As String, _
Optional pInitialDir As String) _
As String
'CALLS -->
'ahtCommonFileOpenSave
On Error GoTo Proc_Err
Dim mFilename As String
mFilename = Nz(ahtCommonFileOpenSave( _
ahtOFN_FILEMUSTEXIST Or _
ahtOFN_HIDEREADONLY Or _
ahtOFN_NOCHANGEDIR, _
IIf(IsMissing(pInitialDir), _
CurrentProject.Path, pInitialDir), _
pFilter, _
, , , pTitle, , True))
If Len(mFilename) = 0 Then Exit Function
On Error Resume Next
BrowseFile = mFilename
Proc_Exit:
Exit Function
Proc_Err:
MsgBox Err.Description, , _
"ERROR " & Err.Number & " BrowseFile"
'comment out next line after debugged
Stop: Resume
Resume Proc_Exit
End Function
'~~~~~~~~~~~~~~~~~~~~
you can also use his Function GetOpenFile, which takes
varDirectory and varTitleForDialog as parameters.
Sometimes, I want to send a filter, which is why I made a
seperate BrowseFile function in my databases
'~~~~~~~~~~~~~~~~~~~~
Warm Regards,
Crystal
Microsoft Access MVP 2006
*
Have an awesome day
remote programming and training
strive4peace2006 at yahoo.com
*