Hi Mike, The code was working absolutely fine on my system and I tried now again, again it is working fine.
1. I've modified it a bit for you but if you still receive the same problem then execute it step-by-step using *F8* Key. 2. I'm using Yahoo Classic version, this code doesn't work in new flash version of yahoo mail. 3. Your internet connection should be very fast to execute this macro. 4. Don't forget to include references from Tools --> Reference to the mentioned libraries. i.e. Internet Controls and HTML Library. 5. Here is the modified Code. Sub Login_and_Search_Yahoo() 'Requires Reference to "Microsoft Internet Controls" 'Requires Reference to "Microsoft HTML Library" 'Declare Reference to InternetExplorer Object Dim MyBrowser As SHDocVw.InternetExplorer 'Set Reference to InternetExplorer Object Set MyBrowser = New SHDocVw.InternetExplorer With MyBrowser 'Make the Browser visible .Visible = True ' Open Yahoo Mail .Navigate "http://mail.yahoo.com" ' Insert Text in Search Box and Click on Search Button. Do Loop Until Not .Busy i = MsgBox("Please provide username and password for your Yahoo Mail. Press ""Yes"" when you're ready", vbOKCancel, "Please Login and wait") Do Loop Until Not .Busy .document.all.searchTheMailFrmtop.msqtop.Value = _ ActiveCell.Value .document.all.searchTheMailFrmtop.mailsearch.Click End With End Sub Rest Solution - http://www.excelitems.com/2009/03/access-search-engines-on-browser.html For more tips, tricks, downloads and problem solutions: visit --> http://www.excelitems.com ------------------------------------------------------------------------ Regards *Ashish **Jain* Analyst, CSC Australia Microsoft Certified Application (Excel) Specialist Technical Trainer - Excel and VBA Author -> www.excelitems.com +91-9999-40-48-43 ------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------- On Mar 15, 9:49 pm, Mike C <js2k...@yahoo.com> wrote: > Thanks again Ashish. You have been very kind. > > This time, however, when I run the macro, My yahoo mail opens, but no > search is performed. > > In excel, I get the following error: > > "Run-time error '-2147467259 (80004005)': > Automation error > Unspecified error" > > I tried playing around with it, but have had no luck. Any ideas what > might be wrong? I provided the HTML below, in case it helps. > > <div id="searchtestfieldstop" class="searchforms"> > <form id="searchTheMailFrmtop" name="searchTheMailFrmtop" > action="/y5/s/search;_ylt=ArD8uqVNMO9zi.gQwuZONpxpk70X?extraargs= > %26.rand%3D726416326%26da%3D0" method="post" target="_top"> > <p> > <label for="msqtop" class="offscreen"> > Search Mail </label> > <input class="inputsearchtext" type="text" size="18" > maxlength=50 name="s" > id="msqtop" value="" /> > <input class="inputbutton" type="submit" > id="mailsearch" name="MailSearch" > value="Search Mail" > title="Search Mail" /> > </p> > </form> > > On Mar 15, 2:13 am, Ashish Jain <26may.1...@gmail.com> wrote: > > > Hi Mike > > > Here is your solution: > > > Sub Login_Yahoo() > > 'Requires Reference to "Microsoft Internet Controls" > > 'Requires Reference to "Microsoft HTML Library" > > 'Declare Reference to InternetExplorer Object > > Dim MyBrowser As SHDocVw.InternetExplorer > > 'Set Reference to InternetExplorer Object > > Set MyBrowser = New SHDocVw.InternetExplorer > > With MyBrowser > > 'Make the Browser visible > > .Visible = True > > ' Open Yahoo Mail > > .Navigate "http://mail.yahoo.com" > > ' Insert Text in Search Box and Click on Search Button. > > .document.all.searchTheMailFrmtop.msqtop.value = > > Activecell.value > > .document.all.searchTheMailFrmtop.mailsearch.Click > > End With > > End Sub > > > Rest Solution > > -http://www.excelitems.com/2009/03/access-search-engines-on-browser.html > > > For more tips, tricks, downloads and problem solutions: visit > > -->http://www.excelitems.com > > ------------------------------------------------------------------------ > > Regards > > *Ashish **Jain* > > Analyst, CSC Australia > > Microsoft Certified Application (Excel) Specialist > > Technical Trainer - Excel and VBA > > Author ->www.excelitems.com > > +91-9999-40-48-43 > > -------------------------------------------------------------------------------------------- > > -------------------------------------------------------------------------------------------- > > > On Mar 15, 5:24 am, Mike C <js2k...@yahoo.com> wrote: > > > > Hello, I am trying to accomplish the following, in case anyone knows > > > how to do it. > > > > I need to (1) take the contents of the active cell, (2) open my yahoo > > > mail in internet explorer(http://us.mc576.mail.yahoo.com/mc/ > > > welcome?.rand=d64n921nnhrdu). > > > > And then (3) to place the active cell contents in the "search mail" > > > search box, and then (3) press enter to display the results. > > > > Does anyone have similar code that shows how this can be accomplished > > > with VBA? > > > > FYI, the HTML shows the form ID as "searchTheMailFrmtop" > > > > (<form id="searchTheMailFrmtop" name="searchTheMailFrmtop" action="/y5/ > > > s/search;_ylt=ArD8uqVNMO9zi.gQwuZONpxpk70X?extraargs=%26.rand > > > %3D324755575%26da%3D0" method="post" target="_top"><p>) > > > > Any suggestions would be greatly appreciated.- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ ------------------------------------------------------------------------------------- Some important links for excel users: 1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at http://www.excelitems.com 2. Excel tutorials at http://www.excel-macros.blogspot.com 3. Learn VBA Macros at http://www.vbamacros.blogspot.com 4. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com If you find any spam message in the group, please send an email to: Ayush Jain @ jainayus...@gmail.com or Ashish Jain @ 26may.1...@gmail.com ------------------------------------------------------------------------------------- -~----------~----~----~----~------~----~------~--~---