Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Writing values to Web Forms

All:

Is it possible to write values, using VB, to a web form in
IE?

Thanks,
Brian A Lopez
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Writing values to Web Forms

Hi Brian,

Yes, but it takes a bit of doing. Check out the following thread to get
some ideas. If you need more assistance, please post back with what URL
you're trying to post data to.

http://groups.google.com/groups?hl=e...%40tkmsftngp07

(watch for URL wrap)

--
Regards,

Jake Marx
www.longhead.com


Brian Lopez wrote:
All:

Is it possible to write values, using VB, to a web form in
IE?

Thanks,
Brian A Lopez


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Writing values to Web Forms

I guess my attempt is extremely complicated.
In the login screen example, I would like to read the text
to the left of the combobox and the enter the appropriate
values before I would click on signon.

Is this even possible, does IE cooperate with VB?


-----Original Message-----
Hi Brian,

Yes, but it takes a bit of doing. Check out the

following thread to get
some ideas. If you need more assistance, please post

back with what URL
you're trying to post data to.

http://groups.google.com/groups?hl=e...=UTF-8&oe=UTF-

8&threadm=ePVhhRXlBHA.2180%40tkmsftngp07

(watch for URL wrap)

--
Regards,

Jake Marx
www.longhead.com


Brian Lopez wrote:
All:

Is it possible to write values, using VB, to a web form

in
IE?

Thanks,
Brian A Lopez


.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 860
Default Writing values to Web Forms

Hi Brian,

Yes, you can do this. If the text is within a named HTML element (if the
element has id="foo" or name="foo" in the tag), it is easier to get via the
GetElementByID or GetElementByName, which are methods of the Document or
Body object, I think. If not, you'll have to search the whole body for it
using Document.Body.InnerText or InnerHTML to get the text or source of the
document body.

So the process would go: 1) navigate to the signon page, 2) read the value
you need using one of the methods above, 3) post the form data to the signon
processing page (the action attribute of the form element), then hopefully
you'll be logged in.

If you continue to have problems, please post the URL, and I'd be happy to
help you further.

--
Regards,

Jake Marx
www.longhead.com


Brian A lopez wrote:
I guess my attempt is extremely complicated.
In the login screen example, I would like to read the text
to the left of the combobox and the enter the appropriate
values before I would click on signon.

Is this even possible, does IE cooperate with VB?


-----Original Message-----
Hi Brian,

Yes, but it takes a bit of doing. Check out the following thread to
get some ideas. If you need more assistance, please post back with
what URL you're trying to post data to.

http://groups.google.com/groups?hl=e...=UTF-8&oe=UTF-

8&threadm=ePVhhRXlBHA.2180%40tkmsftngp07

(watch for URL wrap)

--
Regards,

Jake Marx
www.longhead.com


Brian Lopez wrote:
All:

Is it possible to write values, using VB, to a web form in
IE?

Thanks,
Brian A Lopez


.


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Writing values to Web Forms

"Jake Marx" wrote in message ...

I'm working on a similar problem and having some difficulty.
Two things:

First when I execute this line of code having previously created the
IE object and made it visible

oInt.Navigate sURL, 0, " self", bytePost, sHeader

I get a second IE window. I've played with " self" trying "_SELF",
"_self", etc. to no effect. What am I missing?

Second, the form looks like this:

<form name="content" method="post"
<input type="hidden" size="-1" name="form_validate" value="1"
<input type="hidden" size="-1" name="cid"
<input type="hidden" size="-1" name="cntid"
<input type="hidden" size="-1" name="attid"

I'm sending through a post of

form_validate=1&cid=4343&cntid=&attid=

that is converted by

bytePost = StrConv(bytePostData, vbFromUnicode)

and a header of

sHeader = "Content-Type: " & _
"application/x-www-form-urlencoded" & vbCrLf

Unfortunately, I do not get the expected page.

Any clues?

Thanks,
Richard





Hi Brian,

Yes, you can do this. If the text is within a named HTML element (if the
element has id="foo" or name="foo" in the tag), it is easier to get via the
GetElementByID or GetElementByName, which are methods of the Document or
Body object, I think. If not, you'll have to search the whole body for it
using Document.Body.InnerText or InnerHTML to get the text or source of the
document body.

So the process would go: 1) navigate to the signon page, 2) read the value
you need using one of the methods above, 3) post the form data to the signon
processing page (the action attribute of the form element), then hopefully
you'll be logged in.

If you continue to have problems, please post the URL, and I'd be happy to
help you further.

--
Regards,

Jake Marx
www.longhead.com


Brian A lopez wrote:
I guess my attempt is extremely complicated.
In the login screen example, I would like to read the text
to the left of the combobox and the enter the appropriate
values before I would click on signon.

Is this even possible, does IE cooperate with VB?


-----Original Message-----
Hi Brian,

Yes, but it takes a bit of doing. Check out the following thread to
get some ideas. If you need more assistance, please post back with
what URL you're trying to post data to.

http://groups.google.com/groups?hl=e...=UTF-8&oe=UTF-

8&threadm=ePVhhRXlBHA.2180%40tkmsftngp07

(watch for URL wrap)

--
Regards,

Jake Marx
www.longhead.com


Brian Lopez wrote:
All:

Is it possible to write values, using VB, to a web form in
IE?

Thanks,
Brian A Lopez

.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Writing values to Web Forms

(RJB) wrote in message . com...

I was clearly having a case of the stupids this mourning.

I should have and am now coding
oInt.Navigate sURL, 0, "", bytePost, sHeader
and now the extra windows are gone. I should note that this problem
is only apparent if the windows are visible, but it's there either
way.

The solution to the second problem, not apparent from my original
post, is that I was (duh) sending through the wrong URL.

BTW, there is a useful knowledge base article HOWTO: Use the PostData
Parameter in WebBrowser Control that the group may want to be aware
of.

Also, there are issues in testing readystate complete when the page
referenced has frames (I'm still working that out, but readystate will
go to complete for each frame as near as I can tell). The example code
I've seen will ocassionally fail (it's also timing dependent). There
are also issues determining if the page actually downloaded (still
working that out as well).

Regards,
RJB


"Jake Marx" wrote in message ...

I'm working on a similar problem and having some difficulty.
Two things:

First when I execute this line of code having previously created the
IE object and made it visible

oInt.Navigate sURL, 0, " self", bytePost, sHeader

I get a second IE window. I've played with " self" trying "_SELF",
"_self", etc. to no effect. What am I missing?

Second, the form looks like this:

<form name="content" method="post"
<input type="hidden" size="-1" name="form_validate" value="1"
<input type="hidden" size="-1" name="cid"
<input type="hidden" size="-1" name="cntid"
<input type="hidden" size="-1" name="attid"

I'm sending through a post of

form_validate=1&cid=4343&cntid=&attid=

that is converted by

bytePost = StrConv(bytePostData, vbFromUnicode)

and a header of

sHeader = "Content-Type: " & _
"application/x-www-form-urlencoded" & vbCrLf

Unfortunately, I do not get the expected page.

Any clues?

Thanks,
Richard





Hi Brian,

Yes, you can do this. If the text is within a named HTML element (if the
element has id="foo" or name="foo" in the tag), it is easier to get via the
GetElementByID or GetElementByName, which are methods of the Document or
Body object, I think. If not, you'll have to search the whole body for it
using Document.Body.InnerText or InnerHTML to get the text or source of the
document body.

So the process would go: 1) navigate to the signon page, 2) read the value
you need using one of the methods above, 3) post the form data to the signon
processing page (the action attribute of the form element), then hopefully
you'll be logged in.

If you continue to have problems, please post the URL, and I'd be happy to
help you further.

--
Regards,

Jake Marx
www.longhead.com


Brian A lopez wrote:
I guess my attempt is extremely complicated.
In the login screen example, I would like to read the text
to the left of the combobox and the enter the appropriate
values before I would click on signon.

Is this even possible, does IE cooperate with VB?


-----Original Message-----
Hi Brian,

Yes, but it takes a bit of doing. Check out the following thread to
get some ideas. If you need more assistance, please post back with
what URL you're trying to post data to.

http://groups.google.com/groups?hl=e...=UTF-8&oe=UTF-

8&threadm=ePVhhRXlBHA.2180%40tkmsftngp07

(watch for URL wrap)

--
Regards,

Jake Marx
www.longhead.com


Brian Lopez wrote:
All:

Is it possible to write values, using VB, to a web form in
IE?

Thanks,
Brian A Lopez

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing a UDF Hajiki Excel Discussion (Misc queries) 3 June 16th 08 06:18 PM
Writing UDF Help jlclyde Excel Discussion (Misc queries) 4 April 22nd 08 08:30 PM
Writing to csv Jeff Excel Discussion (Misc queries) 2 March 16th 07 01:35 PM
Help writing an IF statement cynichromantique Excel Worksheet Functions 6 April 1st 06 12:51 AM
Formula Writing Josh[_6_] Excel Programming 2 September 18th 03 06:42 PM


All times are GMT +1. The time now is 10:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"