I'm sorry this is close to redundant, however I have not seen where anyone has handled this: (forced to select '*.csv', strfile will not allow me to concatenate the file path/name with a .csv extension)
I do not want myself or other users to manually select the data, I want it pulled from the input fields I can control in my 'Data_Loc' sheet.
How can I further automate this process to stop the manual file selection?
Thank you for your assistance.
I do not want myself or other users to manually select the data, I want it pulled from the input fields I can control in my 'Data_Loc' sheet.
Code:
Set ws = ActiveWorkbook.Sheets("Data_Loc")
path_l = Range("c1").Value
file_1 = Range("c2").Value
'pick the file to work with, automation fails do to .csv vs .txt extensions
strfile = Application.GetOpenFilename("Text Files (*.csv),*.csv", , "Please select text file...")
Set ws = ActiveWorkbook.Sheets("Update_CSV")
ws.Cells.Clear
'populates Update_CSV sheet with CSV values
With ws.QueryTables.Add(Connection:="TEXT;" & strfile, Destination:=ws.Range("A1"))
.TextFileParseType = xlDelimited
.TextFileCommaDelimiter = True
.Refresh
End With
How can I further automate this process to stop the manual file selection?
Thank you for your assistance.