Results 1 to 17 of 17

code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

Threaded View

ycg0311 code that works fine in excel... 07-20-2012, 11:51 AM
ycg0311 Re: code that works fine in... 07-20-2012, 12:01 PM
ycg0311 Re: code that works fine in... 07-20-2012, 12:09 PM
patel45 Re: code that works fine in... 07-20-2012, 01:32 PM
ycg0311 Re: code that works fine in... 07-23-2012, 11:46 AM
patel45 Re: code that works fine in... 07-23-2012, 01:55 PM
Kyle123 Re: code that works fine in... 07-23-2012, 12:05 PM
ycg0311 Re: code that works fine in... 07-23-2012, 02:01 PM
Kyle123 Re: code that works fine in... 07-23-2012, 02:41 PM
ycg0311 Re: code that works fine in... 07-25-2012, 10:10 AM
Kyle123 Re: code that works fine in... 07-23-2012, 02:37 PM
ycg0311 Re: code that works fine in... 07-23-2012, 02:40 PM
Kyle123 Re: code that works fine in... 07-25-2012, 10:40 AM
ycg0311 Re: code that works fine in... 07-25-2012, 11:45 AM
Kyle123 Re: code that works fine in... 07-25-2012, 11:51 AM
ycg0311 Re: code that works fine in... 07-25-2012, 11:54 AM
ycg0311 Re: code that works fine in... 07-25-2012, 11:56 AM
  1. #1
    Registered User
    Join Date
    07-20-2012
    Location
    houston
    MS-Off Ver
    Excel 2007
    Posts
    10

    code that works fine in excel 2007 ie ver 7 not in excel 2010 ie ver 9

    I had code that creates and IE object and opens a webpage, I write a black source file to my D drive and then populate that black text file with using the innerhtml property of IE. However this code now work in excel 2010 IE ver 9 at least the part where i'm trying to write the innerhtml. Below is the code with the line in question bolded
    Also the error i get is

    run-time error ;2147023179 (800706b5)
    Automation error
    The interface is unknonn


    Sub AECO()
        
        
        ThisWorkbook.Activate
        Sheets("AECO").Select
        Dim blankcell As Range
        Set blankcell = Cells.Find(what:="", after:=Range("C1"), LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByColumns)
        blankcell.Select
        
        datestart = CDate(blankcell.Offset(1, -2).Value)
        numdays = Date - datestart
        dateend = datestart + numdays
        If datestart = Date + 1 Then
            Exit Sub
        Else
            For i = datestart To dateend
            
            
            'Download the file..
            Dim IE, oFS, oTS
            Set IE = CreateObject("InternetExplorer.Application")
            IE.Visible = True
            IE.Silent = False
            
            dayWEB = Day(i)
            If dayWEB < 10 Then dayWEB = 0 & dayWEB
            monthWEB = Month(i)
            If monthWEB < 10 Then monthWEB = 0 & monthWEB
            yearWEB = Year(i)
            dateForWEB = yearWEB & monthWEB & dayWEB
        
            IE.Navigate "https://services.tcpl.ca/cor/public/gdsr/GdsrAlbertaImperial" & yearWEB & monthWEB & dayWEB & ".htm"
            Do While IE.readystate <> 4: Loop
            Const thesourcefile = "GdsrAlbertaImperial.txt"
            Set oFS = CreateObject("Scripting.FileSystemObject")
            Set oTS = oFS.CreateTextFile("C:\" & thesourcefile)
            oTS.Write (IE.document.DocumentElement.Innerhtml)
            oTS.Close
    Last edited by Cutter; 07-20-2012 at 08:53 PM. Reason: Added code tags

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1