Solved

Need to fill up a Text Area.

Posted on 2012-03-22
8
1,512 Views
Last Modified: 2012-04-09
Hi Team,

I am trying to fill text in the Text area of the given below page using Excel VBA.  Please help me with the same.  I am not able to fill this up.

http://www.adfreeclassifieds.com/publish-a-new-ad.htm

Given below is the screen shot of the website part which I want to fill up.
Sample Screen shot
Given below is some of the sample code that I was able to find using google search.   but is does not seem to work.

    Set objCollection = ie.document.getElementsByTagName("textarea")
    i = 0
    While i < objCollection.Length
        If objCollection(i).Name = "description" Then
            objCollection(i).onmouseclick
            objCollection(i).Value = "Sandesh" & vbCrLf
            Set objElement = objCollection(i)
            objElement.Click
        End If
        i = i + 1
    Wend

Please advise how do I achive the same.

Thanks,
Sandesh.
0
Comment
Question by:Sandesh555
8 Comments
 
LVL 29

Assisted Solution

by:pwindell
pwindell earned 100 total points
Comment Utility
If there are not multiple Controls then you don't need a Collection.
You explicitly direct it at the Text Area control.
NameOfControl.Value = "Sandesh" & vbCrLf

I doubt you want to do it based on a MouseClick event either.  If this is all Client-side then maybe on an OnLoad Event.  But if it is Server-Side then you would put the data in a Server-Side Variable and then push it into the Client-Side code from the variable as it is being processed and sent to user's browser.

On top of that an HTML Text Area does not have a Toolbar,...so you are using a Control created by someone else (3rd party),...so you need to verify with the people it comes from exactly how it is done.  They may have handled it in a straight forward way,..and then again maybe they didn't.
0
 

Author Comment

by:Sandesh555
Comment Utility
Hi,

The web page link given can be accessed by all.  So request you to please try and see if you can give me some sample code to get connected.  As anyone can access the site, you can even see what works best.

Thanks,
Sandesh.
0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 100 total points
Comment Utility
Why are you trying to do this?  I do not think you can "fill up" an HTML textarea in a POST-method form.  I think it will take everything you put into it.
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 78

Accepted Solution

by:
David Johnson, CD, MVP earned 200 total points
Comment Utility
The site seems to be working properly?
Is this an excel problem? if so why are you redirecting us to a website?

Is it a website problem?

Are you trying to automate posting on this website?

Are you the website owner and need to populate your database?

Request Advise
0
 
LVL 16

Assisted Solution

by:theo kouwenhoven
theo kouwenhoven earned 100 total points
Comment Utility
Hi  Sandesh555,

I don't think you will ever be able to reach this result, the size of the objCollection.Length will change every time you add an vbCrLf so what you try to do is the same as:
 While i < i+1 :-)

You probably have to store the value first
Set MyVar = objCollection.Length
While i < objCollection.Length
-
-
-
Whend


While i < objCollection.Length you wil
0
 
LVL 78

Assisted Solution

by:David Johnson, CD, MVP
David Johnson, CD, MVP earned 200 total points
Comment Utility
do not think you can "fill up" an HTML textarea in a POST-method form Agreed, though eventually you will get an overflow condition.
0
 

Author Comment

by:Sandesh555
Comment Utility
Hi Team,

To answer your questions, I am trying to fill up the given Website based on the data avalible in Excel file using VBA.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
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 …

772 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now