+ Reply to Thread
Results 1 to 2 of 2

How to open multiple KML-files

  1. #1
    Registered User
    Join Date
    09-13-2016
    Location
    Amsterdam
    MS-Off Ver
    2016, Office365
    Posts
    41

    How to open multiple KML-files

    Hello everyone,

    It's been a long time since I was active here. I usually used VBA for projects at work but after a few switches I'm now back again to automate things.

    Project:
    I have a Userform with multiple tools for calculations etc for the airline I'm working for. I'd like to give users the ability to plot the routes in Google Earth that are stored as *.kml files.

    Problem:
    The routes have the format depdest**.kml where dep = departure station and dest = arrival/destination station. Amsterdam to Madrid looks like AMSMAD01.kml.
    But there is more than 1 route available... 01-09 (normal routes) and 31-34 (contingency routes) and 90-94 (special used routes).
    I am able to let the user open 1 route (AMSMAD01.kml) but it seems impossible to me to get this in a loop to check for all files beginning with AMSMAD. Preferably AMSMAD01 till AMSMAD99. I have found many codes on the internet and I combined them the best I could but still no multiple routes in Google Earth.

    The user has 2 textboxes. The first is to enter the departure station (GC_Pred_dep) and the 2nd is for the arrival station (GC_Pred_dest).
    1.png

    I created the following code. Is anyone able to solve this mystery? Any help is much appreciated!
    EDIT: Google Earth does open en it also opens 1 or 2 routes, but not all. And I suspect that the amount of errors I get when executing the code are equal to the amount of routes that don't show up.
    2.png

    Please Login or Register  to view this content.
    Last edited by Paul85; 08-31-2021 at 03:12 AM.

  2. #2
    Registered User
    Join Date
    09-13-2016
    Location
    Amsterdam
    MS-Off Ver
    2016, Office365
    Posts
    41

    Re: How to open multiple KML-files

    For those who would like to know the same, I got the answer.

    Because of the many .kml-files to be opened at once, I had to add Application.Wait to the code.

    Please Login or Register  to view this content.
    Because of the slow pc's at work I had to put the value at 6 seconds. Now Google Earth is starting first and after 6 seconds the .kml-files will be loaded. Problem solved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. macro to open files and copy specific sheet into new workbook (have open files part)
    By dangerdavedsp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 02:23 PM
  2. Macro to open multiple files, remove header and save multiple files in a new format
    By twocircles in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2014, 05:24 PM
  3. Open multiple pdf files
    By vishesh2804 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-04-2013, 12:31 PM
  4. [SOLVED] Open all files in a SharePoint folder (Problem: Files open out of order)
    By holmstarrunner in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2012, 10:13 AM
  5. Open multiple files
    By Roquete in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 12-22-2010, 06:54 AM
  6. Open multiple files
    By Bob@Sun in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-21-2010, 04:56 AM
  7. Open Multiple Files
    By dashingdude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-16-2007, 05:54 PM

Tags for this Thread

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