2013-06-24 67 views
0

我一直在試圖編寫一個從互聯網上獲取財務信息並將其粘貼到我的宏中以供進一步分析的宏。我一直在嘗試使用來自我現有的一個連接(MSN股票報價)的查詢。使用VBA從Web獲取股票信息

與我的代碼(下面)我已經能夠使查詢彈出,但我不知道該怎麼辦是輸入任何東西到彈出的框中。我基本上在尋找的是如何(在我下面列出的代碼之後)告訴excel在彈出的框中鍵入特定值並單擊「確定」以運行查詢。下面

是我的代碼發起的查詢框詢問行情

With ActiveSheet.QueryTables.Add(Connection:= _ 
    "FINDER;C:\Program Files\Microsoft Office\Office12\QUERIES\MSN MoneyCentral Investor Stock Quotes.iqy" _ 
    , Destination:=Range("$A$1")) 
    .Name = "MSN MoneyCentral Investor Stock Quotes" 
    .FieldNames = True 
    .RowNumbers = False 
    .FillAdjacentFormulas = False 
    .PreserveFormatting = False 
    .RefreshOnFileOpen = False 
    .BackgroundQuery = True 
    .RefreshStyle = xlInsertDeleteCells 
    .SavePassword = False 
    .SaveData = True 
    .AdjustColumnWidth = True 
    .RefreshPeriod = 0 
    .WebSelectionType = xlEntirePage 
    .WebFormatting = xlWebFormattingAll 
    .WebPreFormattedTextToColumns = True 
    .WebConsecutiveDelimitersAsOne = True 
    .WebSingleBlockTextImport = False 
    .WebDisableDateRecognition = False 
    .WebDisableRedirections = True 
    .Refresh BackgroundQuery:=False 
End With 

回答