LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.office.developer.vba
external usenet poster
 
Posts: 7
Default "Folder Select" Dialogue - Opening multiple files from selected folder

Hello Mike

Thanks for the response, unfortunately that didn't quite work either
(same error), but it got me thinking on a different track... I now
have a better understanding of what's going on with the whole
'function' malarkey. I have made it work now by using the following
code:

(Same declarations)
------------------------
Sub Test()
Dim filepath As String
filepath = SelectFolder(filepath)
Workbooks.OpenText Filename:= _
filepath + "\abc.txt", Origin:=xlMSDOS, StartRow:=1, _
(etc...)
EndSub
------------------------
(Same Function)

This brings the string into the Subroutine and avoids the whole
"Compile Error: Argument not optional", the thing I still don't
understand is what goes into the brackets after the folder (the
'argument' ), it seems I can put anything in there and it works out the
same (so long as it's qualified as speech - SelectFolder("anything you
want") - or a variable). I suppose it's because whatever is in there
isn't used by the function.

So anyway, it works. Thanks again for your input.

Rob
ß-)

 
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
How do I prevent Excel 2007 from leaving ".tmp" files in my folder Deb M Excel Discussion (Misc queries) 5 June 4th 09 07:16 PM
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? Subteam Excel Discussion (Misc queries) 2 May 7th 06 08:14 PM
creating an XLS file from " files" data in a Folder Edwin Mashiringwani Excel Discussion (Misc queries) 2 November 19th 05 04:45 PM
Backup to specific folder if workbook names begins with "NSR" or "MAC" GregR Excel Programming 3 May 6th 05 12:24 AM


All times are GMT +1. The time now is 06:50 PM.

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"