Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Dear John
Suggest you to use the FilePicker....try the below Sub Mac() Dim fd As FileDialog Dim strFile As String Set fd = Application.FileDialog(msoFileDialogFilePicker) With fd ..Filters.Add "Excel Files", "*.xls" ..AllowMultiSelect = False If .Show Then strFile = .SelectedItems(1) End With MsgBox strFile End Sub -- If this post helps click Yes --------------- Jacob Skaria "John" wrote: Hi, I'm trying to find a way to programatically return the path of a file. Currently the path(s) are hard coded in the code. I would like to be able to store the new path based on the user selecting the file in the new location: In VBA i run a procedure that opens a file based on a hard coded path. As the file exists in another folder Excel tells me it cant find the file. So i would like to give the user the option to point to the new location of the file. When that file is selected, Excel writes the location of the new path into the code. Is this possible in VBA, and if so, how would i code this please? Thanks for helping me out with this. Regards, John |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
FYI: One macro really helped for capturing data from multiple workbook stored in a specific folder to one excel file only | Excel Programming | |||
Capturing current folder path | Excel Programming | |||
Place Stored Path Into Formulla | Excel Discussion (Misc queries) | |||
Capturing a file path | Excel Programming | |||
Capturing a file path | Excel Programming |