Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I'm working with a form that has an 'open' box and a 'save as' box. How can I specify that the 'current directory' is equal to the directory in which the spreadsheet with the form resides? Here is what I have so far: Thanks - Louis ---------------------- Public Sub listfilesinfoldersandsub1() Dim i As Long Dim Path As String Dim Prompt As String Dim Title As String Dim TempArr() As String Dim PathName As String Dim NewFN As String With Application.FileSearch Dim SaveDriveDir As String SaveDriveDir = CurDir ChDir (SaveDriveDir) NewFN = Application.GetOpenFilename(FileFilter:="Excel Files (*.xls), *.xls", Title:="Please select a file") If NewFN = False Then MsgBox "Stopping because you did not select a file" Exit Sub Else .FileType = msoFileTypeAllFiles .SearchSubFolders = False .Execute PathName = NewFN UserForm1.TextBox1.Value = PathName End If End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change current directory to the directory that the workbook loads from! | Excel Programming | |||
current directory | Excel Discussion (Misc queries) | |||
Current Directory | Excel Discussion (Misc queries) | |||
get current directory | Excel Programming | |||
changing current directory to that of the current open file | Excel Programming |