Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Opening each file in a folder using msoFileDialogFolderPicker | Excel Discussion (Misc queries) | |||
Match file names listed in column with file names in folder | Excel Programming | |||
Extract file names from folder | Excel Programming | |||
Change file names in a folder | Excel Programming | |||
Compare file names to folder contents | Excel Programming |