Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to disable files type combo box in Open Dialog box

Hi All,

My Visual Basic application is using Excel for reporting.

I need to restrict the users of my application to open only excel files from
the File-Open dialogue box.

Or

Is there any way to make default €˜Excel files (*.xls) in the Files type
combo box in the Open dialog box and disabling the Files type combo box, so
that the users can only select excel files when they click File-Open.

Please help me in this regard.
--
ourspt
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default How to disable files type combo box in Open Dialog box

Hi


....
' Asking for file name
Const fTitle = "Select File!"
Const FilterList = "Templates (*.XLS), *.XLS"
fFullName = Application.GetOpenFilename(Title:=fTitle,
FileFilter:=FilterList)
If fFullName = "False" Then
MsgBox ("No file to open!")
ActiveWindow.Close
Exit Sub
End If
....


Arvi Laanemets


"ourspt" wrote in message
...
Hi All,

My Visual Basic application is using Excel for reporting.

I need to restrict the users of my application to open only excel files

from
the File-Open dialogue box.

Or

Is there any way to make default 'Excel files (*.xls)' in the Files type
combo box in the Open dialog box and disabling the Files type combo box,

so
that the users can only select excel files when they click File-Open.

Please help me in this regard.
--
ourspt



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to disable files type combo box in Open Dialog box


You can disable the file menu

and let the user select a file through a function you write like this

Function GetImportFileName()

Dim Filt As String
Dim FilterIndex As Integer
Dim FilaName As Variant
Dim Title As String
Dim i As Integer
Dim Msg As String

Filt = "Text Files (*.txt),*.txt," & _
"Lotus Files (*.prn),*.prn," & _
"ASCII Files (*.asc),*.asc," & _
"All Files (*.*),*.*,"

FilterIndex = 4

Title = "Select a File to Import"

Filename = Application.GetOpenFilename( _
FileFilter:=Filt, _
FilterIndex:=FilterIndex, _
Title:=Title, _
MultiSelect:=False _
)
If Filename = "False" Then

MsgBox "No file was selected."
Exit Function

End If

GetImportFileName = Filename

End Function

kaak


--
Kaak
------------------------------------------------------------------------
Kaak's Profile: http://www.excelforum.com/member.php...fo&userid=7513
View this thread: http://www.excelforum.com/showthread...hreadid=477437

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default How to disable files type combo box in Open Dialog box

You've gotten other replies to your other posts, too.

ourspt wrote:

Hi All,

My Visual Basic application is using Excel for reporting.

I need to restrict the users of my application to open only excel files from
the File-Open dialogue box.

Or

Is there any way to make default €˜Excel files (*.xls) in the Files type
combo box in the Open dialog box and disabling the Files type combo box, so
that the users can only select excel files when they click File-Open.

Please help me in this regard.
--
ourspt


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Microsoft Excel Viewer cannot open files of this type (xlsx) [email protected] Setting up and Configuration of Excel 3 April 22nd 23 09:01 PM
How to change default Open/Files of Type to "Microsoft Excel Files Tammy Excel Discussion (Misc queries) 2 January 14th 08 11:06 PM
Open Dialog Box in Excel 2007 Scrolls Past Files Bob Gutjahr Excel Discussion (Misc queries) 0 August 18th 07 01:38 PM
disabling the Files type combo box areddy Excel Discussion (Misc queries) 1 October 19th 05 02:37 PM
Open find file dialog multiple files Magius00 Excel Programming 5 May 6th 05 09:44 AM


All times are GMT +1. The time now is 08:46 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"