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!!
.
|