|
-
Nov 1st, 1999, 08:12 PM
#1
Thread Starter
Fanatic Member
Anyone got any ideas on how to return a filename from the xldialogopen dialog? I can only seem to get it to return true.
-
Nov 2nd, 1999, 05:04 PM
#2
Thread Starter
Fanatic Member
Am I posting these questions at the wrong forum? If so, can anyone tell me where I should be posting them (no rude ones)?
-
Nov 2nd, 1999, 09:58 PM
#3
Hyperactive Member
Use something like this:
Dim FileToOpen as string
FileToOpen = Application.GetOpenFilename("All Files,.*")
Select Case FileToOpen
Case False
MsgBox "File not selected.", vbInformation
'show your form again
Case Is <> ""
'show any form you need before the file opens
Application.DisplayAlerts = False
'this next part is recorded in VBA on Excel
'to open a text file and format it automatically in Excel
Workbooks.OpenText Filename:=FileToOpen,
Origin:=xlWindows, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:= _
Array(Array(0, 1) 'etc.
I don't know of any place else to post VBA questions. Most people here are focused on straight VB, but VBA comes up occasionally. They are related enough that some response for VB can help you with VBA.
The best thing about VBA is that you can record what you want to do, and then see the code.
[This message has been edited by billwagnon (edited 11-03-1999).]
-
Nov 2nd, 1999, 10:20 PM
#4
Thread Starter
Fanatic Member
Thanks billwagnon, works great. I don't suppose you have any suggestions for how to just select a folder, rather than an actual file. I'm looking to set the default location for output files....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|