Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 57
Default Application.GetOpenFilename

I would like Application.GetOpenFilename to prompt me to select a folder,
then open all files in that folder. What is the proper syntax please?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Application.GetOpenFilename

John

This will open all the .xls files in the selected folder

Sub Open_All_Files()
Application.DisplayAlerts = False
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
MyPath = .SelectedItems(1)
End With
ActiveFile = Dir(MyPath & "*.xls")
Do While ActiveFile < ""
Workbooks.Open Filename:=MyPath & ActiveFile
ActiveFile = Dir()
Loop
Application.DisplayAlerts = True
End Sub

Mike

"John" wrote:

I would like Application.GetOpenFilename to prompt me to select a folder,
then open all files in that folder. What is the proper syntax please?


.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default Application.GetOpenFilename

I forgot to mention that in the folder picker you must 'Double Click' to
select the folder then OK

Mike

"Mike H" wrote:

John

This will open all the .xls files in the selected folder

Sub Open_All_Files()
Application.DisplayAlerts = False
With Application.FileDialog(msoFileDialogFolderPicker)
.Show
MyPath = .SelectedItems(1)
End With
ActiveFile = Dir(MyPath & "*.xls")
Do While ActiveFile < ""
Workbooks.Open Filename:=MyPath & ActiveFile
ActiveFile = Dir()
Loop
Application.DisplayAlerts = True
End Sub

Mike

"John" wrote:

I would like Application.GetOpenFilename to prompt me to select a folder,
then open all files in that folder. What is the proper syntax please?


.

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
Application.GetOpenFileName Chris Excel Programming 7 August 19th 06 12:37 AM
Application.GetOpenFilename vs Application.Dialogs(xlDialogsOpen) Paul Martin Excel Programming 5 August 5th 05 04:44 PM
Application.GetOpenFilename Nigel Excel Programming 0 March 23rd 05 03:24 PM
Application.GetOpenFilename Greg[_19_] Excel Programming 3 February 20th 05 01:55 AM
Application.GetOpenFilename Philipp Oberleitner[_2_] Excel Programming 2 July 9th 04 07:29 PM


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