Hi Friends,
I'm working on a way to automatically update Exchange Rate info for a DB I'm working on. In Excel, I found a nifty feature that allows me to import a table from the web. I am using the Federal Reserve Bank in NY as my reference.
Here's the code that Excel generated:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL; Destination:=Range("A1" _
))
.Name = "noon"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = True
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
This works beautifully in getting the table of data I want into Excel. I then tried to get it to run automatically with no security warnings or prompting, but I was ultimately stymied.
Is there a reasonably easy way to move this code into Access and have it still work? I'm enough of an Access neophyte that I believe this is possible, but I'm not sure.
Can anyone give me a tip or a link or anything otherwise helpful?
TIA
Regards,
Nedstar1
I'm working on a way to automatically update Exchange Rate info for a DB I'm working on. In Excel, I found a nifty feature that allows me to import a table from the web. I am using the Federal Reserve Bank in NY as my reference.
Here's the code that Excel generated:
With ActiveSheet.QueryTables.Add(Connection:= _
"URL; Destination:=Range("A1" _
))
.Name = "noon"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = True
.BackgroundQuery = True
.RefreshStyle = xlOverwriteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "19"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
End Sub
This works beautifully in getting the table of data I want into Excel. I then tried to get it to run automatically with no security warnings or prompting, but I was ultimately stymied.
Is there a reasonably easy way to move this code into Access and have it still work? I'm enough of an Access neophyte that I believe this is possible, but I'm not sure.
Can anyone give me a tip or a link or anything otherwise helpful?
TIA
Regards,
Nedstar1