+ Reply to Thread
Results 1 to 6 of 6

Choosing a file to upload on IE with Excel VBA?

  1. #1
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    77

    Choosing a file to upload on IE with Excel VBA?

    Like the title says, I have been stuck on finding a way to select a file I want to upload to a website.

    Unfortunately I cannot copy/paste a file path into a text box and then click the upload button. Instead, the website forces me to click a Choose file/Browse button which then opens up my directory (just like Application.GetOpenFileName). This appears to be done using a javascript function, but I have no idea how to execute the function with VBA. Here is that part of the html:

    Please Login or Register  to view this content.
    I know this may be taking VBA to the fringe of what it's meant for, but if anyone has any suggestions that would be great.

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

    Re: Choosing a file to upload on IE with Excel VBA?

    You can't do this by automating IE, it's a security feature.

    You'll have to either post it directly to the server (which requires a working knowledge of http requests) or give it up as a bad job I'm afraid.

  3. #3
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    77

    Re: Choosing a file to upload on IE with Excel VBA?

    Quote Originally Posted by Kyle123 View Post
    You can't do this by automating IE, it's a security feature.

    You'll have to either post it directly to the server (which requires a working knowledge of http requests) or give it up as a bad job I'm afraid.
    I see.. is this true of all javascript functions or is there something in particular about this one that led you to believe it's for security purposes? Thanks for the response

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

    Re: Choosing a file to upload on IE with Excel VBA?

    It's not JavaScript it's a feature of the File upload HTML control

  5. #5
    Registered User
    Join Date
    07-10-2013
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    77

    Re: Choosing a file to upload on IE with Excel VBA?

    Quote Originally Posted by Kyle123 View Post
    It's not JavaScript it's a feature of the File upload HTML control
    Interesting...did you figure it out from those 2 lines of html or is this a general rule? Are you referring to the actual upload or just selecting the file? I was really under the impression that <script src="http://js-sourceexample.com/ab-999.min.js"></script> is what opened the directory and allowed you to select the file.

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

    Re: Choosing a file to upload on IE with Excel VBA?

    No, I didn't need to, JavaScript can't read files from your computer, it must use an HTML File control for that and that's the bit you'd need to automate (which you can't)

+ 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. Upload a Excel file to a SharePoint
    By sur in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-10-2012, 10:54 PM
  2. Upload Excel file to Sharepoint using Macro
    By gtg653t in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-10-2008, 10:43 AM
  3. upload excel file into sql server
    By vic pahilan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-04-2005, 07:35 AM
  4. Upload Excel DIF file to AS400
    By GregR in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-25-2005, 12:05 PM
  5. [SOLVED] How do I automate upload of data from one excel file to another?
    By RB in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-11-2005, 11:06 AM

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