Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 27th, 2009, 06:08 AM
Registered User
 
Join Date: Feb 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with msinet.ocx

Hi everyone!

I've just recently (today) started to develop VBA code so I decided to sign up here. So first of all I just want to say Hi and say that I'll try my best to contribute all I can to this forum. But for now...I have a problem.

My first task was to write a Macro that would obtain data from a website and output it into another cell. The programming was going great until I ran into MSInet.ocx. The code below shows that I use Inet. I downloaded MSInet.ocx, put it into my system32 folder and registered it using regsvr32. I also added it to references in the Microsoft Visual Basic editor. Whenever I try to run the program though, I end up with a Run Time Error 429: ActiveX component can't create object and it stops on the line: Set inet1 = New Inet

If anyone could help me that would be amazing.

Almost forgot I run Vista 32-bit and am using Office 07.

Code:
Sub Competitors()
'
' Competitors Macro
'
' Keyboard Shortcut: Ctrl+Shift+C
'
    Dim country As String
    Dim keyword As String
    Dim myURL As String

    country = Range("A1").Value
    keyword = ActiveCell.Value
    myURL = "http://keywordresearch.webcertain.com/keywordstats2.php?q=" & Replace(keyword, " ", "+") & "%0D%0A&se=Google." & country & "&lang=1&search=Search"

    Dim inet1 As Inet
    Dim mypage As String

    Set inet1 = New Inet
    With inet1
            .Protocol = icHTTP
            .URL = myURL
            mypage = .OpenURL(.URL, icString)
    End With
    Set inet1 = Nothing

    Dim intStart As Integer, intEnd As Integer
    intStart = InStr(mypage, keyword & "", "") + 5
    intEnd = InStr(intStart, mypage, "")

    temperature = Mid(mypage, intStart, (intEnd - intStart))
    ActiveCell.Offset(0, 2).Value = temperature

End Sub
Thanks so much in advance,

Philipp





Similar Threads
Thread Thread Starter Forum Replies Last Post
binary file upload via msinet execute post ftbrady HTML Code Clinic 0 November 20th, 2008 05:46 PM
msinet.ocx and Vista jmedway Excel VBA 0 February 11th, 2008 12:50 PM
problem with CRYSTL32.OCX sobhamuktha Pro VB 6 2 March 16th, 2005 05:04 AM
Strong name to msinet wrapper dlls vb.net rameshu007 Classic ASP XML 0 July 13th, 2004 06:07 AM
MSFLXGRD.OCX and MSDATGRD.OCX Clive Astley Access 1 July 25th, 2003 08:47 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.