+ Reply to Thread
Results 1 to 5 of 5

Call VBA on that is located on a website

  1. #1
    Forum Contributor
    Join Date
    09-08-2014
    Location
    Toronto, Canada
    MS-Off Ver
    2007
    Posts
    122

    Angry Call VBA on that is located on a website

    Hi Experts,

    I have this code below that works perfectly when filepath and filename is located on my PC ("c/test.docm" etc..).

    Now that i have stored the files on a server "http://espace.int.test.ca/workspaces/vbProject/" I can not get it to pull the file.

    Please explain what i am doing wrong.


    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    08-01-2012
    Location
    Montreal, Qc, Canada
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Call VBA on that is located on a website

    This is completely different then looking at your local files

    -first thing is add the reference tools to allow you go online
    from VB editor TOOLS--> References
    scroll down until you find "Microsoft Internet Controls" and "Microsoft HTML Object Library" and check them both

    - second thing you'll need to do is open the web page. The below code will Get you there.

    Once your online, you'll need to use the source code to find the elements you want to interact with. If you google "VBA WebScrapping" you should come up with some example that will help.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Call VBA on that is located on a website

    There are two steps, first you need to download the file, then you can run the code as normal (you just need to substitute the file path to the location of the place you've downloaded the document). To download the file, you simply need this http://www.cpearson.com/excel/downloadfile.aspx

    @steve, automating ie best avoided, especially for something as trivial as downloading a file - it's very slow and inefficient

  4. #4
    Registered User
    Join Date
    08-01-2012
    Location
    Montreal, Qc, Canada
    MS-Off Ver
    Excel 2010
    Posts
    82

    Re: Call VBA on that is located on a website

    Thanks Kyle, I dont down load much using Excel, but I've book marked your link in case i need to in the future.

  5. #5
    Forum Contributor
    Join Date
    09-08-2014
    Location
    Toronto, Canada
    MS-Off Ver
    2007
    Posts
    122

    Re: Call VBA on that is located on a website

    Thank you all for the help.

    I have found the below code at https://support.microsoft.com/en-us/kb/177760.
    The code works perfectly for what i was trying to do, can i get some help adding a condition for if file is already open then and also If file is not found then.....

    Please Login or Register  to view this content.
    Last edited by kamaflage; 07-30-2015 at 02:13 PM.

+ 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. website scrapiplping to get data from multiplepages of website
    By mpatil in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2015, 05:00 AM
  2. [SOLVED] Call a sub from another a sub located in another workbook
    By mortphil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-23-2014, 03:52 AM
  3. Averageif WILDCARD for website.com AND EXCLUDE website.com.xx
    By Gerhard.Angeles in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-14-2014, 09:12 AM
  4. Master Command Button to call on other Command Buttons located in other Workbooks
    By MrNickRegan in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-05-2013, 07:57 PM
  5. Opening website, getting data, closing website
    By beta_leonis in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-27-2012, 03:50 AM
  6. How to set call count according to call date and time
    By naveen4pundir in forum Access Tables & Databases
    Replies: 0
    Last Post: 04-27-2012, 02:13 AM
  7. Replies: 2
    Last Post: 06-25-2006, 12:10 PM

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