Solved

VBA to fill-in web form

Posted on 2014-11-08
10
149 Views
Last Modified: 2014-11-22
We buy a lot of items at Sam's Club.  I wrote an Excel VBA program to keep track of the inventory, and to automate the purchase of items. A couple of days ago they change something on the site.  Looks the same, but the coding is different.  If you look at the front page, you'll see a search box and a magnifying glass next to it that works as a search button.  It is the search button we cannot click programmatically.  Any ideas?
And before someone asks, no, Sam's Club does not have an API for placing orders, and they say they have no intentions of creating one.
0
Comment
Question by:rrhandle8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 45

Expert Comment

by:aikimark
ID: 40431550
please post the code that you currently use
0
 

Author Comment

by:rrhandle8
ID: 40440808
Code is attached.

I got it to work by adding the two lines that start with "-->"
SamsClub-sample.txt
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40440828
What data is in column A of your Items worksheet?  Just want to see one or two examples.

I think your code is overly complicated because you're using IE
0
Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

 

Author Comment

by:rrhandle8
ID: 40448895
Suggestions to using IE?
0
 
LVL 45

Expert Comment

by:aikimark
ID: 40448902
please give me some examples of what is in column A of your worksheet.
It looks like you're just putting the URL if the search succeeds.  Am I reading this wrong?
0
 

Author Comment

by:rrhandle8
ID: 40448944
Item#
13433230
14484656
15574090
15667515
15870476
15905012
16130065
80005208
0
 

Author Comment

by:rrhandle8
ID: 40448969
aikimark,

I got it to work with the following changes on these lines. I think it was the extra pause that did the trick.
So, what is a faster way to do this than using IE?

        ie.Document.getElementById("searchBar").Focus    'get the focus point of the input box
        Func.PauseBrowser
        SendKeys "~"    'do search
        Func.PauseBrowser

Open in new window

0
 
LVL 45

Expert Comment

by:aikimark
ID: 40448972
I manually searched for those items and nothing was returned.
0
 

Author Comment

by:rrhandle8
ID: 40448979
Old items.  I didn't know we were going to do a search on them.  Here are some active ones.

34488
196449
242249
341375
571453
651234
747192
995786
999999
0
 
LVL 45

Accepted Solution

by:
aikimark earned 500 total points
ID: 40453072
This is an interesting problem.  The codes you are searching are a mix of Sam's specific and general (Walmart) values.  If your worksheet contained the Sam's values, the MSXML2 object is the desired solution.  It has less overhead and is faster than the IE automation solution.  Unfortunately, I haven't been able to find a good combination of URI keywords that will yield reliable results for non-Sam's values.  The best thing to do would be to accept your own comment, http:#a40448969 , as the solution.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question