Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default 'Open File' Functionality

I am looking to add 'open file' functionality to a VBA program. I would
like to give the user the ability to browse a through directories to
find and select a file. The functionality would be similar to the
window that comes up when you go to File/Open.

Is there a simple way to add this functionality (perhaps a VBA command)
or is there freely available code that does this?

thanks

- db79

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 'Open File' Functionality

Here is some VBA code that I have used to "browse" for a file, then
display the document's name into the selected cell.


Sub browse1()

Range("E6").Select
Var1 = Application.GetOpenFilename(FileFilter:="Word Files (*.doc),
*.doc", Title:="Full Document Name")
fileToOpen = Right(Var1, Len(Var1) - InStrRev(Var1,
Application.PathSeparator))
ActiveCell.Value = fileToOpen

End Sub

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
Excel Template functionality without using "File-New" Denise Excel Discussion (Misc queries) 3 January 8th 10 07:27 PM
In Excel - Use Windows Explorer instead of File Open to open file KymY Excel Discussion (Misc queries) 1 August 5th 06 09:59 PM
Open a file do a macro ( made) and open next succesive file SVTman74 Excel Programming 5 April 21st 06 10:14 PM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 2 July 8th 05 05:51 AM
Open File or Switch Between Windows if File is Open Ricky Pang Excel Programming 0 July 2nd 05 08:41 PM


All times are GMT +1. The time now is 01:54 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"