Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
browse to find file
Hello. Is it possible to have excel via vba allow a user to browse through
folders (like when a user clicks on FileOpen), but instead of actually opening the file they select, I would like the file to be copied to a specified location (variable called infopath) AND also have the name of the file selected inserted into cell A1? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
browse to find file
fname = Application.GetOpenfileName
This will display the fileopen dialog and return the name and path of the file selected (or typed in). It will not open the file. You can then use the results to copy the file. The dichotomy here is that it is unclear what file is being copied. -- Regards, Tom Ogilvy "Steph" wrote in message ... Hello. Is it possible to have excel via vba allow a user to browse through folders (like when a user clicks on FileOpen), but instead of actually opening the file they select, I would like the file to be copied to a specified location (variable called infopath) AND also have the name of the file selected inserted into cell A1? Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
browse to find file
Check out GetOpenFilename in VBA help to show how to browse a file.
If you open it, you can then saveas to the new location and close it immediately, after saving the name ActiveWorkbook.SaveAs Filename:= .... ThisWorkbook.Range("A1").Value = ActiveWorkbook.FullName ActiveWorkbook.Close -- HTH RP (remove nothere from the email address if mailing direct) "Steph" wrote in message ... Hello. Is it possible to have excel via vba allow a user to browse through folders (like when a user clicks on FileOpen), but instead of actually opening the file they select, I would like the file to be copied to a specified location (variable called infopath) AND also have the name of the file selected inserted into cell A1? Thanks! |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
browse to find file
Thanks guys!
"Bob Phillips" wrote in message ... Check out GetOpenFilename in VBA help to show how to browse a file. If you open it, you can then saveas to the new location and close it immediately, after saving the name ActiveWorkbook.SaveAs Filename:= .... ThisWorkbook.Range("A1").Value = ActiveWorkbook.FullName ActiveWorkbook.Close -- HTH RP (remove nothere from the email address if mailing direct) "Steph" wrote in message ... Hello. Is it possible to have excel via vba allow a user to browse through folders (like when a user clicks on FileOpen), but instead of actually opening the file they select, I would like the file to be copied to a specified location (variable called infopath) AND also have the name of the file selected inserted into cell A1? Thanks! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Browse File for Mac | Excel Discussion (Misc queries) | |||
can't browse file | Excel Discussion (Misc queries) | |||
excel vba browse file | Excel Programming | |||
excel vba browse file | Excel Programming | |||
File Browse Box | Excel Programming |