Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use macro to open an specific file
To anyone that can help me:
I need to create a macro that allows the user to select a specific file, no matter what the name of the file is. Also, the file may be located anywhere. In short, I want to enable the user to select the file in any directory location, but, when it opens, has the restriction of the content validation. Can someone give me a light? Thank you!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to use macro to open an specific file
Hello Rafael,
To prompt the user for the file to open, use something like: Sub Macro1() Dim myfile As String myfile = Application.GetOpenFilename() Workbooks.Open FileName:=myfile End Sub Look at the help in VBA for all of the valid options for GetOpenFilename(). Not sure what you mean by "has the restriction of the content validation" though. Hope this helps, Kris -----Original Message----- To anyone that can help me: I need to create a macro that allows the user to select a specific file, no matter what the name of the file is. Also, the file may be located anywhere. In short, I want to enable the user to select the file in any directory location, but, when it opens, has the restriction of the content validation. Can someone give me a light? Thank you!! . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Is there a way to open an excel file to a specific worksheet? | Excel Discussion (Misc queries) | |||
Open file to specific tab | Excel Discussion (Misc queries) | |||
Help with a macro to open to a specific worksheet | Excel Worksheet Functions | |||
Macro to open specific File | Excel Discussion (Misc queries) | |||
Open Specific File | Excel Programming |