MrExcel Publishing
Your One Stop for Excel Tips & Solutions

directory and drivelist to Dave


Posted by amroo on April 13, 2001 4:51 AM

Hi Dave, thank you for your help, but now I want to put the path of my selected file into a macro to open it for an application. Am I clear?
Amroo


Posted by Dave Hawley on April 13, 2001 4:29 PM


Is this what you mean ?


Private Sub CommandButton1_Click()
'Written by OzGrid Business Applications
'www.ozgrid.com
Dim SFileandPath As String
SFileandPath = Application.GetOpenFilename
If SFileandPath = "False" Then Exit Sub
Workbooks.Open SFileandPath
End Sub

Dave


OzGrid Business Applications

Posted by amroo on April 16, 2001 5:48 AM

As you read below here the code of my importation file. Where (my_value) & (value) are the string that I wrote before in inputboxes.
So I want when I click on the path that the value goes to the place of ChDir and the follow code.
in places of (my_value) and (value).
""""""""""""""""""""
ChDir (my_value)
Workbooks.OpenText Filename:=((my_value) & "\" & (value)), Origin:=xlWindows, StartRow:=3,
DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 1), Array(4, 1), Array(23, 1), Array(55, 2), Array(78, 2), Array(98, 1), Array(118, 1))

2001 regards.
Amroo