Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Using the FolderPicker (along with Microsoft Scripting Runtime), how do I
open the dialog box in a specific folder (say c:\temp) Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Show ' ???? instruction for the dialog box to open in c:\temp End With Regards Michel |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How about:
Option Explicit Sub testme01() Dim fd As FileDialog Dim curFolder As String Dim newFolder As String newFolder = "C:\temp" curFolder = CurDir ChDir newFolder ChDrive newFolder Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Show End With ChDir curFolder ChDrive curFolder End Sub MD wrote: Using the FolderPicker (along with Microsoft Scripting Runtime), how do I open the dialog box in a specific folder (say c:\temp) Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Show ' ???? instruction for the dialog box to open in c:\temp End With Regards Michel -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is strange.... I used your exemple... and It worked(only one time) I
modified the value of "newFolder" to D:\temp and it still gave me C:\temp ?? I close the workbook (but kept EXCEL open)... same thing...... I closed EXCEL all together and it now worked. It seems that changing the value of newFolder is tricky. Say you want to add "IF" this then newfolder X value "IF" that then newfolderYvalue Option Explicit Sub testme01() Dim fd As FileDialog Dim curFolder As String Dim newFolder As String newFolder = "C:\temp" curFolder = CurDir ChDir newFolder ChDrive newFolder Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Show End With ChDir curFolder ChDrive curFolder End Sub...???? "Dave Peterson" a écrit dans le message de ... How about: Option Explicit Sub testme01() Dim fd As FileDialog Dim curFolder As String Dim newFolder As String newFolder = "C:\temp" curFolder = CurDir ChDir newFolder ChDrive newFolder Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Show End With ChDir curFolder ChDrive curFolder End Sub MD wrote: Using the FolderPicker (along with Microsoft Scripting Runtime), how do I open the dialog box in a specific folder (say c:\temp) Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Show ' ???? instruction for the dialog box to open in c:\temp End With Regards Michel -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It worked ok the ONE time I tested.
But I couldn't get it to change initial folders. Maybe you could use Jim Rech's BrowseForFolder.zip at: http://www.bmsltd.ie/MVP/Default.htm MD wrote: This is strange.... I used your exemple... and It worked(only one time) I modified the value of "newFolder" to D:\temp and it still gave me C:\temp ?? I close the workbook (but kept EXCEL open)... same thing...... I closed EXCEL all together and it now worked. It seems that changing the value of newFolder is tricky. Say you want to add "IF" this then newfolder X value "IF" that then newfolderYvalue Option Explicit Sub testme01() Dim fd As FileDialog Dim curFolder As String Dim newFolder As String newFolder = "C:\temp" curFolder = CurDir ChDir newFolder ChDrive newFolder Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Show End With ChDir curFolder ChDrive curFolder End Sub...???? "Dave Peterson" a écrit dans le message de ... How about: Option Explicit Sub testme01() Dim fd As FileDialog Dim curFolder As String Dim newFolder As String newFolder = "C:\temp" curFolder = CurDir ChDir newFolder ChDrive newFolder Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Show End With ChDir curFolder ChDrive curFolder End Sub MD wrote: Using the FolderPicker (along with Microsoft Scripting Runtime), how do I open the dialog box in a specific folder (say c:\temp) Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .Show ' ???? instruction for the dialog box to open in c:\temp End With Regards Michel -- Dave Peterson -- Dave Peterson |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try following:
Set fd = Application.FileDialog(msoFileDialogFolderPicker) fd.InitialFileName = "c:\temp" With fd .Show End With Jan -- Message posted from http://www.ExcelForum.com |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In win98/xl2002, I had to use:
fd.InitialFileName = "c:\temp\" And to keep it from making it the current directory: Option Explicit Sub testme01() Dim fd As FileDialog Dim curFolder As String Dim newFolder As String newFolder = "C:\temp\" curFolder = CurDir ChDir newFolder ChDrive newFolder Set fd = Application.FileDialog(msoFileDialogFolderPicker) With fd .InitialFileName = newFolder .Show End With ChDir curFolder ChDrive curFolder End Sub (Thanks for posting the solution, w0rm.) "w0rm <" wrote: Try following: Set fd = Application.FileDialog(msoFileDialogFolderPicker) fd.InitialFileName = "c:\temp" With fd Show End With Jani --- Message posted from http://www.ExcelForum.com/ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to delete the "Insert Function Dialog Box" (dialog box only)? | Excel Worksheet Functions | |||
Use of Dialog | New Users to Excel | |||
dialog box | Excel Discussion (Misc queries) | |||
control of dialog macro dialog box. on open | Excel Programming | |||
VBA for Dialog Box | Excel Programming |