Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application.GetOpenFilename as new worksheet in current workbook

Status
Not open for further replies.

celestedeeva

Programmer
Aug 27, 2007
14

Hello all,

How do I use the:

Application.GetOpenFilename("Excel files (*.xls), *.xls")

so that the selected Excel file is opened into a new worksheet of he current workbook with the worksheet name the name of the selected excel file from the Application.GetOpenFilename("Excel files (*.xls), *.xls") selection?

all help is appreciated.

Celeste
 
Explain the logic behind opening a workbook into a new worksheet exactly please?

If you want to copy a single worksheet from the opened book into the current workbook, then that would be fine, as long as you knew which sheet of the opened workbook was to be copied ( maybe there's only one sheet per opened workbook ).

Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Hello,

Thank you again for the response - essentially I have a series of excel files that I wish to "import" into a currently open workbook's worksheet via a command button.

I want to click the command button - browse to the Excel file, select the Excel file and have all information of its first worksheet imported into a new worksheet of the currently opened workbook active worksheet - preferably imported as the next available worksheet at the end and name the worksheet for the excel file selected.

Is this possible and am I making myslef clear above.

Once again thank you for any response.

Celeste.
 
Have you tried using the macro recorder to record yourself doing this manually? If not, please do so - it should give you a starting pooint in code. Then, if you have any specific issues with making it work on an automated basis, please post back

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
I'd suggest using the open dialog box to browse for the required file and DAO to import the records.

Everybody is somebodys Nutter.
 
Thanks - I am going to take a look at the macro recording suggestion and see what I can up with using DAO as well.

Will let you know if I am successful.

Celeste.
 



Hi,

Check out Data > Import Data > New Database Query...

faq68-5829

Skip,

[glasses] When a group touring the Crest Toothpaste factory got caught in a large cooler, headlines read...
Tooth Company Freeze a Crowd! and
Many are Cold, but Few are Frozen![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top