Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Apr 3, 1:02*pm, Newq wrote:
Does anyone know how to Declare and Call the dll to update stock quotes combined with a timer so that quotes are automatically updated after the close I'm not sure which part of MSN your wanting exactly, but here's a VBA code I put together for you that will grab some US stocks and refresh them every 15mins or every time you run the macro. Sub Stocks() Dim n As Single Dim exist As Boolean For n = 1 To Sheets.Count Sheets(n).Activate If ActiveSheet.Name = "Stocks" Then exist = True End If Next n If exist = False Then Sheets.Add.Name = "Stocks" End If Worksheets("Stocks").Activate Cells.Clear With ActiveSheet.QueryTables.Add(Connection:= _ "URL;http://moneycentral.msn.com/investor/market/ usindex.aspx", Destination:= _ Range("A1")) .Name = "usindex" .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = False .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 15 .WebSelectionType = xlSpecifiedTables .WebFormatting = xlWebFormattingAll .WebTables = "6,7" .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MSN Stock Quote | Excel Worksheet Functions | |||
Declare Function for global use then call on change event | Excel Programming | |||
stock quote add in | Excel Discussion (Misc queries) | |||
Declare API call to Windows GetFile | Excel Programming | |||
How do I get a refreshable stock quote for S | Excel Discussion (Misc queries) |