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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Use File Open Dialog Box In VBScript 1

Status
Not open for further replies.

AnilKumar

Programmer
Dec 5, 2000
26
IN
Hi All ,
I Want to popup a file dialog box thru VBScript , Can any one tell me how I can do that , I am new to Vbscript. Any help is welcomed.
Thx in advance
Anil.
 
dim cdl1
dim txtfile
set cdl1 = createobject("MSComDlg.CommonDialog")
cdl1.MaxFileSize = 10000 'filter files to lesser than 10k
cdl1.ShowOpen()
txtFile = cdl1.filename
msgbox txtfile 'will show selected file path
 
Sorry the maxfile size gives the size of the cache file to store filenames.. in KB.. 10000 = 10000Kb
 
This one's been out here a while. I hope posting to it will bring it basck up to the top for someone to answer.

I've looked and looked for just this solution. Thanks so much. However, I get the error that states, "Class not licensed for use." How do I license the class. I would have thought that MS Common Dialogs are already licensed for use.


Randy Davis, MCP
Data Analyst

 
GetObject requires a COM object; The Windows CommonDialog is really not COM, its just a DLL, but there is a COM object thats a wrapper for CommonDialog.

I get the same error. In my Registry "MSComDlg.CommonDialog" refers to COMDLG16.OCX (& Comdlg32.ocx), which looks like a COM to me. (HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{F9043C85-F6F2-101A-A3C9-08002B2F49FB})
.. if thats any help
 
Hello rrdavis07 & ClayG,

To get the license on each box, you have to install a relatively big development tool vb5 control editor which by itself is very useful. The main thing is that it comes as free utility.

Otherwise, try G Born's wrapper around it WSHShellExtend ActiveX from his site.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top