+ Reply to Thread
Results 1 to 4 of 4

VBA automation of IE - submit text to site then copy image back to Excel

  1. #1
    Registered User
    Join Date
    06-27-2013
    Location
    New Hampshire, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    VBA automation of IE - submit text to site then copy image back to Excel

    I know there are some threads for using Excel to load a webpage and submit username/pw information, but my needs are a little bit different.

    I'm trying to take a character string from a cell, copy it into a free QR code generator (ex| http://goqr.me/ ), and bring the resulting image back into my spreadsheet. I like this generator because you don't need to click "submit" - it updates the image as the text is entered. Assuming/hoping that feature makes this easier.

    Is this feasible? Trying to avoid the installation of new barcode fonts and the purchasing of barcode specific packages.

    UPDATE:

    Using the below code, I can get the browser to open and enter the desired text. I need a way to get the image back into my spreadsheet now. The code I'm using currently just returns "[object]" in C1.


    Please Login or Register  to view this content.
    Last edited by ALN1991; 01-20-2015 at 02:02 PM. Reason: updating

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA automation of IE - submit text to site then copy image back to Excel

    Hello ALN1991,

    Copy the code below into a new VBA module. The macro DownloadQRCode will need a few changes.

    You will need to change the file name and location and the message you want to encode. These are in blue font.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-27-2013
    Location
    New Hampshire, USA
    MS-Off Ver
    Excel 2010
    Posts
    25

    Re: VBA automation of IE - submit text to site then copy image back to Excel

    This is brilliant, thank you. It saves the image perfectly. It seems like importing the image through VBA should be the simple part but I'm having a surprisingly difficult time of doing that. I've been trying for some time now to automate the process of adding an image by referencing its URL as an alternative to saving it on my computer, but I will try to add the file that is being saved (to my desktop for now) with your code.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: VBA automation of IE - submit text to site then copy image back to Excel

    Hello ALN1991,

    VBA does not have any native functions to handle downloading pictures from the web to the worksheet. It can be done using more Windows API calls to copy the file to the clipboard and paste it to the worksheet.

    I went with this method because it is a lot less code to deal with and if anything didn't work correctly it is easier to isolate the problem.

+ 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. Replies: 3
    Last Post: 11-22-2013, 10:43 AM
  2. VBA code that will follow excel hyperlink to word doc & copy text back into excel
    By crnadeau4 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-22-2013, 11:51 AM
  3. Password automation for .RefreshAll when linking to FTP site
    By Muzza68 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-27-2012, 03:36 AM
  4. Excel to Web Automation (Submit button Not Working)
    By plasma33 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-14-2012, 09:39 AM
  5. Hypertext link to external site automation
    By Tom Throckmorto in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-05-2007, 06:22 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