Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to ask user for file to open

I have a template that I am putting a macro that will load data from another spreadsheet. However, I do not know what the other spreadsheet name will be. How can I ask the user to open the spreadsheet that contains the data

Thank

Dwaine Horto
York International
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default How to ask user for file to open

Dwain

one way is to use an inputbox to request the information from the user. Something like
filetoget = InputBox("Enter the name of the file to open.", , "c:\temp\filetoopen.xls"

This will give a variable with the filename (including path if required) which can then be used to open the file
Workbooks.Open FileName:=filetoge

Ton

----- Dwaine Horton wrote: ----

I have a template that I am putting a macro that will load data from another spreadsheet. However, I do not know what the other spreadsheet name will be. How can I ask the user to open the spreadsheet that contains the data

Thank

Dwaine Horto
York International
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default How to ask user for file to open

Hi
another way:
filename=Application.getopenfilename("Excel Files (*.xls), *.xls")

--
Regards
Frank Kabel
Frankfurt, Germany

Dwaine Horton wrote:
I have a template that I am putting a macro that will load data from
another spreadsheet. However, I do not know what the other
spreadsheet name will be. How can I ask the user to open the
spreadsheet that contains the data?

Thanks

Dwaine Horton
York International

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
Macro To Open a User selected File Chris Excel Worksheet Functions 2 September 6th 07 08:58 PM
File is already open by user X eagle13 Excel Discussion (Misc queries) 1 July 24th 06 01:14 PM
not being prompted that user has file open maryj Excel Discussion (Misc queries) 0 December 15th 05 03:10 PM
open ftp file specifying user id and password Mike[_45_] Excel Programming 0 August 29th 03 08:56 PM


All times are GMT +1. The time now is 03:33 AM.

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

About Us

"It's about Microsoft Excel"