+ Reply to Thread
Results 1 to 5 of 5

Automate File Upload

  1. #1
    Registered User
    Join Date
    11-30-2011
    Location
    Philly, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Automate File Upload

    Hi,

    I am trying to automate uploading a weekly file to a secure file transfer .aspx site.
    I have all fields completed except for the type="file" field which will not allow to be filled with VBA.

    I have tried the following with no sucess:
    Set FLE = appIE.Document.getElementsByName("FileUpload1")
    FLE(0).Value = "C:\Weekly_File.xls"

    My hope is that I might be able to enter this file name with a different type of coding. I downloaded iMacros for IE and the step it uses to load the file is this code:
    TYPE=INPUT:FILE FORM=NAME:FormDefault ATTR=ID:FileUpload1 CONTENT=C:\Weekly_File.xls

    Is there a way I could run this line of code from VBA?

    Any help is populating this field is appreciated.

    Thank you

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

    Re: Automate File Upload with VBA

    For what it's worth I've never found a reliable way round this (and I've spent a while looking), that type of input is deliberately designed to stop automation from the browser so the user knows what they are uploading.

    I'm not saying it can't be done, just a pain

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

    Re: Automate File Upload with VBA

    Actually, just had another look, this looks quite promising - could it work for you?

    http://www.motobit.com/tips/detpg_uploadvbaie/

  4. #4
    Registered User
    Join Date
    11-30-2011
    Location
    Philly, USA
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: Automate File Upload with VBA

    I saw this earlier but I don't understand it. It is described like a good way to send the file, but I also need to select people to email from the .aspx site. Not sure it will work for me.

    Thanks for looking, I have spend a month looking too and have come up short, hence the post here.

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Automate File Upload with VBA

    You can use Excel's builtin facilities to save a file as an ftp-file.
    You have to add an ftp site to the list that is being displayed in the dialogscreen 'SaveAs' enter your username and password.
    After that you can save teh file saveas

    Please Login or Register  to view this content.
    or you can produce an ftp-script, save it and execute it:

    Please Login or Register  to view this content.



+ Reply to Thread

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