Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 25
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to open an excel file to a specific worksheet? Nicholas Excel Discussion (Misc queries) 1 December 5th 06 10:29 PM
Open file to specific tab [email protected] Excel Discussion (Misc queries) 5 June 16th 06 03:55 AM
Help with a macro to open to a specific worksheet EAHRENS Excel Worksheet Functions 0 November 30th 05 08:36 PM
Macro to open specific File tamato43 Excel Discussion (Misc queries) 4 May 18th 05 09:42 PM
Open Specific File DB100[_3_] Excel Programming 2 May 10th 04 09:17 AM


All times are GMT +1. The time now is 07:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"