I Googled a line of the code and found a site which told me what references
to set. One was named slightly differently from those listed on my computer
but the .dll file was shown so I browsed for it.
It really seems that the best approach is to try to see if someone has done
what you want to do (via Google) and then adapt it. Every software writer
writes their own .dlls and some even write object libraries which you can
easily use in VBA. Beyond that it is usually a question of trying to get
the intellisense to tell you what to do.
Regards
David Grugeon
Moderator - Excel VBA
Original message
> -----Original Message-----
> From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On Behalf
Of
> PatrickM
> Sent: Thursday, November 26, 2009 1:45 AM
> To: ExcelVBA@yahoogroups.com
> Subject: [ExcelVBA] Re: Put data to Web Page
>
> Hello,
> Please excuse my jumping in.
> David, you raise a good question for me: how did you know which references
to set?
> More generally, when I look at the Tools / References in the IDE, I see a
huge number of
> choices. How do I know what they all do? Is there a Help somewhere on
this?
> I feel like my ability with Excel VBA could expand if I just had a quick
feel for "I want to
> do X; I will need the reference Y and the objects A, B, and C."
> Thank you,
> Pat
>
> --- In ExcelVBA@yahoogroups.com, "David Grugeon" <yahoo@...> wrote:
> >
> > Hi Sujit
> >
> > I just put the code in a module (actually it was the sheet1 module) in a
new
> > workbook. I set the references
> >
> > Microsoft HTML Object library, and
> > Microsoft Internet controls.
> >
> > Ran the sub using F5 from the IDE and it just worked.
> >
> > I am using Windows XP, Excel 2007 SP2, and IE 8.
> >
> > I also get the error on
> >
> > oBrowser.timeout = 60
> >
> > which does not seem to matter.
> >
> > but no error on
> >
> > HTMLDoc.all.inputtext.Value = "ALBK"
> >
> > I doubt if this is helpful to you but hope you solve your problem.
> >
> > Best Regards
> > David Grugeon
> > Moderator ExcelVBA Group
> >
> > -----Original Message-----
> > From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On
Behalf
> > Of Sujit Talukder
> > Sent: Tuesday, 24 November 2009 3:55 PM
> > To: ExcelVBA@yahoogroups.com
> > Subject: RE: [ExcelVBA] Put data to Web Page
> >
> > Thanks David for the reply.
> >
> > You said it runs fine on your computer and putting the dates. Please
suggest
> > the way how you did it?
> >
> > When I removed the error handler code, It throws an error - Run time
error
> > 438. Object doesnot support this property or method. At this line:
> >
> > oBrowser.timeout = 60
> >
> > If I comment it out, then at this line:
> >
> > HTMLDoc.all.inputtext.Value = "ALBK"
> >
> >
> >
> > Which reference need I use?
> >
> > I am now using :
> >
> > Microsoft HTML object Library.
> >
> > Microsoft Internet controls
> >
> >
> >
> >
> >
> > _____
> >
> > From: ExcelVBA@yahoogroups.com [mailto:ExcelVBA@yahoogroups.com] On
Behalf
> > Of David Grugeon
> > Sent: 24 November 2009 02:39
> > To: ExcelVBA@yahoogroups.com
> > Subject: RE: [ExcelVBA] Put data to Web Page
> >
> >
> >
> >
> >
> > OK.. I found the references. It runs fine on my computer and puts the
dates
> > in. I suggest you try commenting out the error handling code and see if
it
> > is throwing an error.
> >
> > Best Regards
> > David Grugeon
> > Moderator ExcelVBA Group
> >
> > -----Original Message-----
> > From: ExcelVBA@yahoogroup <mailto:ExcelVBA%40yahoogroups.com> s.com
> > [mailto:ExcelVBA@yahoogroup <mailto:ExcelVBA%40yahoogroups.com> s.com]
On
> > Behalf
> > Of skt2114
> > Sent: Monday, 23 November 2009 8:18 PM
> > To: ExcelVBA@yahoogroup <mailto:ExcelVBA%40yahoogroups.com> s.com
> > Subject: [ExcelVBA] Put data to Web Page
> >
> > I am using the following code to open a web page and put value to web
page
> > controls.
> >
> > Dim HTMLDoc As HTMLDocument
> > Dim oBrowser As InternetExplorer
> > Sub Login_2_NSE()
> > Dim oHTML_Element As IHTMLElement
> > Dim sURL As String
> >
> > On Error GoTo Err_Clear
> > sURL = "http://www.nseindia
> > <http://www.nseindia.com/content/equities/eq_scriphistdata.htm>
> > .com/content/equities/eq_scriphistdata.htm"
> > Set oBrowser = New InternetExplorer
> > oBrowser.Silent = True
> > oBrowser.timeout = 60
> > oBrowser.navigate sURL
> > oBrowser.Visible = True
> >
> > Do
> > ' Wait till the Browser is loaded
> > Loop Until oBrowser.readyState = READYSTATE_COMPLETE
> >
> > Set HTMLDoc = oBrowser.document
> > HTMLDoc.all.inputtext.Value = "ALBK"
> > HTMLDoc.all.Series.Value = "EQ"
> > HTMLDoc.all.FromDate.Value = "01-01-1990"
> > HTMLDoc.all.ToDate.Value = "23-11-2009"
> > Err_Clear:
> > If Err <> 0 Then
> > Err.Clear
> > Resume Next
> > End If
> > End Sub
> >
> > The code is putting the values "ALBK" and "EQ" but not the FromDate and
> > Todate.
> >
> > Can someone please help me to sort out the problem so that the code will
> > insert Fromdate and toDate and then click the "Get Results" button on
the
> > web page.
> >
> > ------------------------------------
> >
> > ----------------------------------
> > Be sure to check out TechTrax Ezine for many, free Excel VBA articles!
Go
> > here: http://www.mousetra <http://www.mousetrax.com/techtrax>
x.com/techtrax
> > to enter the ezine, then search the
> > ARCHIVES for EXCEL VBA.
> >
> > ----------------------------------
> > Visit our ExcelVBA group home page for more info and support files:
> > http://groups. <http://groups.yahoo.com/group/ExcelVBA>
> > yahoo.com/group/ExcelVBA
> >
> > ----------------------------------
> > More free tutorials and resources available at:
> > http://www.mousetra <http://www.mousetrax.com> x.com
> >
> > ----------------------------------Yahoo! Groups Links
> >
> >
> >
> >
> >
> > [Non-text portions of this message have been removed]
> >
> >
> >
> > ------------------------------------
> >
> > ----------------------------------
> > Be sure to check out TechTrax Ezine for many, free Excel VBA articles!
Go
> > here: http://www.mousetrax.com/techtrax to enter the ezine, then search
the
> > ARCHIVES for EXCEL VBA.
> >
> > ----------------------------------
> > Visit our ExcelVBA group home page for more info and support files:
> > http://groups.yahoo.com/group/ExcelVBA
> >
> > ----------------------------------
> > More free tutorials and resources available at:
> > http://www.mousetrax.com
> >
> > ----------------------------------Yahoo! Groups Links
> >
>
>
>
>
> ------------------------------------
>
> ----------------------------------
> Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go
here:
> http://www.mousetrax.com/techtrax to enter the ezine, then search the
ARCHIVES for
> EXCEL VBA.
>
> ----------------------------------
> Visit our ExcelVBA group home page for more info and support files:
> http://groups.yahoo.com/group/ExcelVBA
>
> ----------------------------------
> More free tutorials and resources available at:
> http://www.mousetrax.com
>
> ----------------------------------Yahoo! Groups Links
>
>
>
------------------------------------
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.
----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA
----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com
----------------------------------Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ExcelVBA/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ExcelVBA/join
(Yahoo! ID required)
<*> To change settings via email:
ExcelVBA-digest@yahoogroups.com
ExcelVBA-fullfeatured@yahoogroups.com
<*> To unsubscribe from this group, send an email to:
ExcelVBA-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/