Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming,microsoft.public.office.developer.vba
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I prevent Excel 2007 from leaving ".tmp" files in my folder | Excel Discussion (Misc queries) | |||
How to decide folder-depth or How to select more folders/subfolders (folder-tree) ? | Excel Discussion (Misc queries) | |||
creating an XLS file from " files" data in a Folder | Excel Discussion (Misc queries) | |||
Backup to specific folder if workbook names begins with "NSR" or "MAC" | Excel Programming |