Hello,

I am trying to download a csv file from a website by using the import external data function. I have created a macro that does it but I want to generalise it. In the Macro below I would like that:

a) Instead of using ds090312fo (which stands for 12 March 2009)
to use the previous business day, i.e. today Monday we should use
090313 (13 March 2009)).

Does anyone have a clue? Any help on the questions would be highly appreciated. THANK YOU VERY MUCH!

Pep

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 16/03/2009 by Ppg
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;[url]http://www.liffe.com/data/ds090312fo.csv", Destination:=Range("A1"))
.Name = "ds090312fo"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
End Sub