Thread: Excel VBA
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
[email protected] pfsardella@yahoo.com.nospam is offline
external usenet poster
 
Posts: 172
Default Excel VBA

This will allow you to select a file to open. You'll need to add
error handling. See VBE help for options with GetOpenFilename.

Dim strF as String
strF = Application.GetOpenFilename
Workbooks.Open FileName:=strF

HTH
Paul
--------------------------------------------------------------------------------------------------------------
Be advised to back up your WorkBook before attempting to make changes.
--------------------------------------------------------------------------------------------------------------

Hello:

I have a macro that goes to the My Documents folder and
opens a specific file. Is there a way that I can enter a
parameter for the file name, so that I can have the macro
open any filename that I specify?

Thanks for your help.

Theresa