locked
Old Google Earth macro quit working RRS feed

  • Question

  • Hi All.......

    The following macro used to work, some time ago, but no longer does.....

    It fails on the line:

    "Set ge = New EARTHLib.ApplicationGE"

    Here's the macro......if anyone can help, it would be much appreciated.

    Thanks

    Chuck, CABGx3

    Sub GoogleEarthBethel()
    Dim Site
    Dim Lattitude As Double
    Dim Longitude As Double
    Site = "BET"
    Dim lastrow
      lastrow = Cells(Rows.Count, "a").End(xlUp).Row
      For r = lastrow To 35 Step -1
            Cells(r, "A").Select
            If Selection.Value = Site Then
             Selection.Offset(0, 9).Select
              Lattitude = Selection.Value
             Selection.Offset(0, 5).Select
              Longitude = Selection.Value
            GoTo 100
            Else
            End If
      Next r
    100
    Dim ge As ApplicationGE
      Set ge = New EARTHLib.ApplicationGE
      ge.SetCameraParams _
        lat:=Lattitude, _
        lon:=Longitude, _
        alt:=500, _
        altMode:=1, _
        Range:=1, _
        Tilt:=0, _
        Azimuth:=360, _
        speed:=5
      Range("a1").Select
      Range("a35").Select
    End Sub


    Chuck, CABGx3

    Thursday, September 21, 2017 3:13 AM

Answers

  • Hey Dan.......

    Many thanks for your assistance, but further testing on a different computer, also WinXP, showed the same Excel file, (and the problem macros), to work perfectly.  They called up Google Earth properly and displayed the appropriate location according to the coordinates specified in the macros.  

    Apparently the problem has something to do with my original computer, or maybe the GE installation,  not really an EXCEL problem.

    So, thanks again for your assistance and time.

    My best to you and yours,

    Chuck, CABGx3


    Chuck, CABGx3

    • Marked as answer by CABGx3 Saturday, September 23, 2017 10:01 PM
    Saturday, September 23, 2017 5:56 PM

All replies

  • You need to set VB Reference to the 'Earth 1.0 Type Library'.

    Enter the Visual Basic Editor by hitting [Alt] + [F11]
    Open the menu, <Tools - References...>
    Scroll down until you find the 'Earth 1.0 Type Library'
    Put a checkmark next to it, and close the References Dialog

    Thursday, September 21, 2017 6:58 AM
  • Thanks much for the reply Dan, but that item is already checked.  I tried to answer before but I guess the etherMonster got it....sorry.
     
    BUT, I forgot to mention in my first post that I am still using Windows XP, Excel 2000, and do get an error message as follows:
     
    Run time error 429
    ActiveX component cannot open object
     
    I don't know what that means, or how to fix it....... maybe you or someone else does.
     
    Thanks,
    Chuck, CABGx3

    Chuck, CABGx3

    Friday, September 22, 2017 3:33 PM
  • Another thing......

    I just tried running the macro with Google Earth already open on my computer and got a different Error Message:

    Run-Time error "430"

    Class does not support Automation or does not support expected interface.

    The object of the macro is of course to open Google Earth and go to a pre specified place identified by coordinates provided by the macro, as derived from a table.

    Any help would be appreciated,

    Chuck, CABGx3


    Chuck, CABGx3

    Friday, September 22, 2017 7:16 PM
  • Well, with a old OS and a old Excel like that, I'm not sure, that I can help you, since I won't be able to reproduce or test properly...

    ...however, I do have an Windows XP, running Excel 2003, in a Virtual Machine, so I might be able to give it a try.

    But, I will need your spreadsheet to test on, since anything I come up with otherwise will be pure gureesing (I that is not really my style :-)

    So, you're welcome to mail me your spreadsheet, and I'll give it a try.

    • Proposed as answer by Dan ElgaardMVP Saturday, September 23, 2017 9:25 PM
    Friday, September 22, 2017 7:50 PM
  • Thanks Dan.......

    I just checked the file, and it works the same in XL2000, XL2003 and XL2010 with windowsXP.

    It's a 9.2meg file........

    My email is crobertsATSYMBOLtampabay.rr.YOUKNOWWHAT

    If you drop me an email I can send it back to you.

    Chuck, CABGx3


    Chuck, CABGx3

    Saturday, September 23, 2017 2:12 AM
  • Mail sent...

    You can find my contact info here:

    http://www.EXCELGAARD.dk/Lib/FAQ/Contact/ 

    Saturday, September 23, 2017 7:00 AM
  • Hey Dan.......

    Many thanks for your assistance, but further testing on a different computer, also WinXP, showed the same Excel file, (and the problem macros), to work perfectly.  They called up Google Earth properly and displayed the appropriate location according to the coordinates specified in the macros.  

    Apparently the problem has something to do with my original computer, or maybe the GE installation,  not really an EXCEL problem.

    So, thanks again for your assistance and time.

    My best to you and yours,

    Chuck, CABGx3


    Chuck, CABGx3

    • Marked as answer by CABGx3 Saturday, September 23, 2017 10:01 PM
    Saturday, September 23, 2017 5:56 PM