LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Using commondialog.showopen

Hi,

I was wondering, is there a way to retreive only a path using the showopen
window?

I use the following sub:

Private Sub CreateMDSFilesButton_Click()
On Error GoTo err
CommonDialog1.DialogTitle = "Set MDS save directory"
CommonDialog1.Filename = ""
CommonDialog1.Filter = "*.*"
CommonDialog1.ShowOpen
Call assignparam("MDS Directory:", CurDir & "\") ' this write the directory
name in a cell where I can retreive it later
Call CreateMDSfiles ' this creates the new files in 'CurDir\'
Exit Sub

err:
If err.Number = 32755 Then Exit Sub ' cancel button has been used : nothing
needs be done
MsgBox (err.Number)
Resume Next
End Sub


Here is what happens: I want to create a number of files in a directory.
If there are files in the directory then my sub works, the problem comes
when there are no files at all in the directory or a create a new one (using
rightclicknew folder): the window will not close if a file is not
selected. A workaround is to create empty txt file (using
rightclicknewtextfile)but I would not call this a nice solution.

Any idea would be more then welcome.

Thanks,

Didier




 
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
"Unspecified Error" with CommonDialog in Excel 2002 after updates. Tim M.[_2_] Excel Programming 0 December 4th 03 10:06 PM
CommonDialog Error Syed Zeeshan Haider[_3_] Excel Programming 3 November 19th 03 07:50 PM
CommonDialog Error Clement Excel Programming 2 November 19th 03 11:19 AM


All times are GMT +1. The time now is 09:32 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"