Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Find File
Can I create a macro that would go to the C: Drive and allow me to pick a
file and open it. I want to be able to choose the file after I hit the macro button. -- Gary Baker |
#2
|
|||
|
|||
Gary
The code below, throws the standard Open File dialog, allows you to find the file, clicking OK captures the name in the variable fName, but does not open it. The next line does that, using the name in the variable to identify the file to open Sub OpenFile() Dim fName As String fName = Application.GetOpenFilename() Workbooks.Open Filename:=fName End Sub -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England HIS "GWB Direct" wrote in message ... Can I create a macro that would go to the C: Drive and allow me to pick a file and open it. I want to be able to choose the file after I hit the macro button. -- Gary Baker |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can't always find XLA file | Excel Discussion (Misc queries) | |||
looking for a way to find a Missing file Microsoft Office 2000 D. | Excel Discussion (Misc queries) | |||
the system cannot find file specified | Excel Discussion (Misc queries) | |||
Read Text File into Excel Using VBA | Excel Discussion (Misc queries) | |||
Windows cannot find file message | Excel Discussion (Misc queries) |