June 26, 2016
Hello everyone from Maurizio
My new problem is this:
If we write this piece of code inside a routine:
Filename = Sheet.range ("A1"). Value Path = App.Path & "\ Data_TXT \" & Filename & ".txt"
It should be deduced that in the cell of the excel sheet (A1) you can put the name to be
given to the file; before it is saved.
And so far everything is ok
Now what I would like to know is this:
If by hypothesis I wanted to recover the contents of the file (TXT)
The only way I know to make the procedure understand that I want that type of file previously
called this way and with those types of data inside it
I would write this:
Dim a As Long, line As String, arr () As String Dim Filename 'As String Dim Path 'As String Filename = Sheet.range ("A1"). Value Path = App.Path & "\ Data_TXT \" & Filename & ".txt" Open Path For Input As # 1 Line Input # 1, line Close # 1 arr = Split (line, ",") For a = 1 To UBound (arr) List1.AddItem (arr (a)) Next a finish: End Sub
But if Always by hypothesis the I did not know the name I gave to the saved file.
Inside the procedure what should I write instead of:
Filename = Sheet.range ("A1"). Value
Path = App.Path & "\ Data_TXT \" & This ______ Filename & ".txt"
That's all. Thank you
Greetings from A.Maurizio
1 Guest(s)