Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default can msoFileDialogFolderPicker display file names in the folder

I am using the following section of code to have a user select a location to
save a newly created file (the name is already determined - newname)

With Application.FileDialog(msoFileDialogFolderPicker)
.Show
newloc = .SelectedItems(1)
End With

ActiveWorkbook.SaveAs Filename:=CStr(newloc) & "\" & newname

Everything works fine, but the FolderPicker only displays folders and no
contents.

While this is not critical, I would like the user to see the folder contents
for reference and it is just bugging me that I can't do this.

I know that changing to FilePicker will do this, but then the user is
picking a name and not using the predetermined newname (which I would
prefer).

Is there a way to have the FolderPicker display the folder content?
or
If using FilePicker how can you force the predetermined name to be used?


--
If this helps, please remember to click yes.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default can msoFileDialogFolderPicker display file names in the folder

Try the below..Doesnt that odd that the user will have to type or select a
file to get the FilePicker OK button enabled...

Dim strFolder As String
With Application.FileDialog(msoFileDialogFilePicker)
.Show
newloc = .SelectedItems(1)
End With
strFolder = Left(newloc, InStrRev(newloc, "\"))
ActiveWorkbook.SaveAs Filename:=strFolder & newname

If this post helps click Yes
---------------
Jacob Skaria


"Paul C" wrote:

I am using the following section of code to have a user select a location to
save a newly created file (the name is already determined - newname)

With Application.FileDialog(msoFileDialogFolderPicker)
.Show
newloc = .SelectedItems(1)
End With

ActiveWorkbook.SaveAs Filename:=CStr(newloc) & "\" & newname

Everything works fine, but the FolderPicker only displays folders and no
contents.

While this is not critical, I would like the user to see the folder contents
for reference and it is just bugging me that I can't do this.

I know that changing to FilePicker will do this, but then the user is
picking a name and not using the predetermined newname (which I would
prefer).

Is there a way to have the FolderPicker display the folder content?
or
If using FilePicker how can you force the predetermined name to be used?


--
If this helps, please remember to click yes.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default can msoFileDialogFolderPicker display file names in the folder

Set the initial file name to the new name and then Open the dialog

Dim strFolder As String
With Application.FileDialog(msoFileDialogFilePicker)
.InitialFileName = newname
.Show
newloc = .SelectedItems(1)
End With
strFolder = Left(newloc, InStrRev(newloc, "\"))
ActiveWorkbook.SaveAs Filename:=strFolder & newname

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Try the below..Doesnt that odd that the user will have to type or select a
file to get the FilePicker OK button enabled...

Dim strFolder As String
With Application.FileDialog(msoFileDialogFilePicker)
.Show
newloc = .SelectedItems(1)
End With
strFolder = Left(newloc, InStrRev(newloc, "\"))
ActiveWorkbook.SaveAs Filename:=strFolder & newname

If this post helps click Yes
---------------
Jacob Skaria


"Paul C" wrote:

I am using the following section of code to have a user select a location to
save a newly created file (the name is already determined - newname)

With Application.FileDialog(msoFileDialogFolderPicker)
.Show
newloc = .SelectedItems(1)
End With

ActiveWorkbook.SaveAs Filename:=CStr(newloc) & "\" & newname

Everything works fine, but the FolderPicker only displays folders and no
contents.

While this is not critical, I would like the user to see the folder contents
for reference and it is just bugging me that I can't do this.

I know that changing to FilePicker will do this, but then the user is
picking a name and not using the predetermined newname (which I would
prefer).

Is there a way to have the FolderPicker display the folder content?
or
If using FilePicker how can you force the predetermined name to be used?


--
If this helps, please remember to click yes.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 269
Default can msoFileDialogFolderPicker display file names in the folder

Thanks,

Both ideas look a little better than the blank FolderPicker method, that
just gives me an odd feeling that I was was doing something, but not quite
sure exactly what.

I like the one with the InitialFileName set even though it then does not
show the files within the folder.
--
If this helps, please remember to click yes.


"Jacob Skaria" wrote:

Set the initial file name to the new name and then Open the dialog

Dim strFolder As String
With Application.FileDialog(msoFileDialogFilePicker)
.InitialFileName = newname
.Show
newloc = .SelectedItems(1)
End With
strFolder = Left(newloc, InStrRev(newloc, "\"))
ActiveWorkbook.SaveAs Filename:=strFolder & newname

If this post helps click Yes
---------------
Jacob Skaria


"Jacob Skaria" wrote:

Try the below..Doesnt that odd that the user will have to type or select a
file to get the FilePicker OK button enabled...

Dim strFolder As String
With Application.FileDialog(msoFileDialogFilePicker)
.Show
newloc = .SelectedItems(1)
End With
strFolder = Left(newloc, InStrRev(newloc, "\"))
ActiveWorkbook.SaveAs Filename:=strFolder & newname

If this post helps click Yes
---------------
Jacob Skaria


"Paul C" wrote:

I am using the following section of code to have a user select a location to
save a newly created file (the name is already determined - newname)

With Application.FileDialog(msoFileDialogFolderPicker)
.Show
newloc = .SelectedItems(1)
End With

ActiveWorkbook.SaveAs Filename:=CStr(newloc) & "\" & newname

Everything works fine, but the FolderPicker only displays folders and no
contents.

While this is not critical, I would like the user to see the folder contents
for reference and it is just bugging me that I can't do this.

I know that changing to FilePicker will do this, but then the user is
picking a name and not using the predetermined newname (which I would
prefer).

Is there a way to have the FolderPicker display the folder content?
or
If using FilePicker how can you force the predetermined name to be used?


--
If this helps, please remember to click yes.

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
Opening each file in a folder using msoFileDialogFolderPicker Ayo Excel Discussion (Misc queries) 2 January 23rd 13 10:03 PM
Match file names listed in column with file names in folder K[_2_] Excel Programming 1 March 16th 09 04:26 PM
Extract file names from folder Haraki Excel Programming 5 August 24th 06 09:12 PM
Change file names in a folder TISR Excel Programming 2 April 12th 06 01:35 PM
Compare file names to folder contents marlea[_14_] Excel Programming 3 March 16th 06 03:59 PM


All times are GMT +1. The time now is 01:29 AM.

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"