Connecting To Internet Using Ms-Excel Vba Macro
Connecting To Internet Using Ms-Excel Vba Macro
txt
CONNECTING TO INTERNET USING MS-EXCEL VBA MACRO This sample code provides an example of how you can connect to a web browser and to a website using VBA which is the programming engine behind Microsoft Excel applications. Once you are connected you can use a variety of functions entering data into the webpage automatically using the data available in excel or vice-versa i.e storing data available in the web page into MS-Excel. You can even navigate across pages automatically. This sample program connects to an instance of internet explorer(precisely v7) and opens up a sample site called example.com. Though the actions vary from browser to browser, the idea is that you can indeed connect to the internet and do client side data processing pretty automatically only limited by your imagination. Private Sub CommandButton1_Click() Dim IeBro As InternetExplorer Dim IeDoc As HTMLDocument Dim asdf As HTMLDialog Dim a As Integer ' Declare variables if you want to process data Set IeBro = CreateObject("InternetExplorer.Application") IeBro.Visible = True 'Ist page of the Webpage start1: With IeBro .AddressBar = False .StatusBar = False .MenuBar = False .Toolbar = 0 .Visible = True .Navigate "http://example.com" End With While IeBro.Busy Wend While IeBro.Document.ReadyState <> "complete" 'look for the status message in your browser - can vary with browser Wend Set IeDoc1 = IeBro.Document On Error GoTo 10 ' Call error code IeBro.Quit End Sub
-1-