View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ludo Ludo is offline
external usenet poster
 
Posts: 74
Default filter file extension on remote pc for file open

Hi,

I'm using the code below to select a certain log file on a remote PC.
------------------------------------------
frmSelectKast.Show
If CancelSelect = 1 Then Exit Sub
With Application.FileDialog(msoFileDialogOpen)
If HassKast = 1 Then
.InitialFileName = "\\Kndclt21079\barcoview\Bvw_DMT
\bvw_av_prog\Bin\Logs" 'FMT LOG files kast 1 !!!
.Title = "FMT LOG files kast 1"
Else
.InitialFileName = "\\Kndclt21063\logs" 'FMT LOG files
kast 2 !!!
.Title = "FMT LOG files kast 2"
End If
.Filters.Add "FMT LOG files", "*.log", 1
.FilterIndex = 1
.AllowMultiSelect = False
.InitialView = msoFileDialogViewDetails
.Show
If .SelectedItems.Count = 0 Then Exit Sub
FName = .SelectedItems(1)
End With
-------------------------------
The idea is to select only the *.log files on the remote PC
Thats why i use following lines in the code:
.Filters.Add "FMT LOG files", "*.log", 1
.FilterIndex = 1

But if my dialog opens up there appears an other type of file in the
"Files of type " textbox.
I expect that the *.log would be the first (and only?) kind of files
that would be visible.

What is going wrong here?

Any help welcome

regards,
Ludo