Hello Friends,
I have another question on Excel VBA.
Our company saves file with certain information everyday in a standard format which contains the previous working date.
For example today (ie 11th March) a file is saved with name in this format- Capital_2008_03_10.txt
I have to develop a macro that automatically pulls the above file everyday and converts into excel. Is It possible to do so ?
Had it been today’s date I would have used this code:
I cant use Now()-1 because of weekends and holidays. Any ideas how I can automatically pull this file?
Thanks for the help.
Peace
I have another question on Excel VBA.
Our company saves file with certain information everyday in a standard format which contains the previous working date.
For example today (ie 11th March) a file is saved with name in this format- Capital_2008_03_10.txt
I have to develop a macro that automatically pulls the above file everyday and converts into excel. Is It possible to do so ?
Had it been today’s date I would have used this code:
Code:
Workbooks.OpenText FileName:= _
"\\C:\User_data\Files\Input_Files\Capital-" & Format(Now(), "yyyy-mm-dd") & ".txt", Origin:=437, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0, 2), Array(5, 1), Array(11, 4), Array(21, 4), Array(32, 1), Array(35, 1), Array(51,1), Array(71, 1), Array(91, 1)), TrailingMinusNumbers:=True
I cant use Now()-1 because of weekends and holidays. Any ideas how I can automatically pull this file?
Thanks for the help.
Peace