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!

Help me Please (Problem with File Open Dialog Box) 1

Status
Not open for further replies.

AnilKumar

Programmer
Dec 5, 2000
26
IN
Hi All,
Please Help me to create a file Open Dialog box from a stand alone VBS file (without HTML)
I have tried following code..

dim cdl1
dim txtfile
dim vis
set vis=createobject("visio.application")
set cdl1 = createobject("MSComDlg.CommonDialog")
cdl1.showopen
txtFile = cdl1.filename
msgbox txtfile

But it gives Initialisation failed error.I don't know why this is happening.I am new to VBScript.

Anil.
 
Anil,

You must include this line after the createobject...

Code:
cdl1.MaxFileSize = 128

Not necessary in VB but is needed in VBScript.

Later, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top