Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Ask user a file name

Hello,

I need to write a macro that asks the user the name of a excel file and then
copy a sheet of it into a new workbooks without opening the file.

I already start with this piece of code, but I do not know how to use the
file name:

file= Application.GetOpenFilename(FileFilter:="Excel Files (*.XLS), *.XLS", _
Title:="Select File To Be Opened")
If file = False Then _
Exit Sub

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,420
Default Ask user a file name

You have to open it, no question about it. GetOpenFilename returns the
selected filename with full path which you can use to open the file, do your
copy, then close it.

--
__________________________________
HTH

Bob

"Lucile" wrote in message
...
Hello,

I need to write a macro that asks the user the name of a excel file and
then
copy a sheet of it into a new workbooks without opening the file.

I already start with this piece of code, but I do not know how to use the
file name:

file= Application.GetOpenFilename(FileFilter:="Excel Files (*.XLS),
*.XLS", _
Title:="Select File To Be Opened")
If file = False Then _
Exit Sub

Thanks



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
User replaces existing file with blank during file open sjs Excel Discussion (Misc queries) 3 August 18th 08 06:16 PM
Prompt user to select file with default file selected dialog Bruce Cooley Excel Programming 0 September 15th 03 06:43 AM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:22 PM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:19 PM


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