Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with File dialog box.

Status
Not open for further replies.

AnilKumar

Programmer
Dec 5, 2000
26
IN
I am using following code to display a file dialog box..

dim cdl1
dim txtfile
set cdl1 = createobject("MSComDlg.CommonDialog")
cdl1.showOpen
txtFile = cdl1.filename
msgbox txtfile

when I tried to run this code , it gives "The Common dialog function failed during initialisation" error.
please help me to fix this problem.
Thanks,
anil.

 
try to filter the files by setting the maxfile size:

dim cdl1
dim txtfile
set cdl1 = createobject("MSComDlg.CommonDialog")
cdl1.MaxFileSize = 10000 '(restricted to files lesser than 10k)
cdl1.ShowOpen()
txtFile = cdl1.filename
msgbox txtfile
 
Sorry the maxfile size gives the size of the cache file to store filenames.. in KB.. 10000 = 10000Kb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top