Internet Explorer Object | Pop up Window

roy.aritra

New Member
Joined
Jul 20, 2011
Messages
2
Hello,

I am very new to VBA programming.
I have a VBA project that navigates to a website and then fills up a form. I need to enter the start date and the end date.
When I click on the start_date box it open a pop-up calendar and once I select a date the end date takes the next 30 days (by default).

I have written a code to fill the start date and end date but that does not allow me to complete the form.


Here is some of my code:

Code:
For Each Item In IE.document.all

    ItemInnerText = ""
    ItemName = ""
    ItemValue = ""
    ItemType = ""
    itemid = ""
    itemclass = ""
        
    On Error Resume Next
        ItemInnerText = Item.innerText
        ItemName = Item.Name
        ItemValue = Item.Value
        ItemType = Item.Type
        itemid = Item.ID
        itemclass = Item.class
            
        'Filling up the name of the campaign
        If itemid = "name" And ItemName = "name" Then
            Item.Value = Sheets("GR_SIP").Range("B2").Value
        End If
        
        'Filling up the shortname of the campaign
        If itemid = "short_name" And ItemName = "short_name" Then
            Item.Value = Left(Sheets("GR_SIP").Range("B2").Value, 8)
        End If
        
        'Entering the start_date of the campaign
        If itemid = "start_date" And ItemName = "start_date" Then
            Item.Value = "2011-06-01"
        End If
        
        'Entering the end_date of the campaign
        If itemid = "end_date" And ItemName = "end_date" Then
            Item.Value = Sheets("GR_SIP").Range("A2").Value
        End If
        
        'Entering the Media numbers
        If itemid = "media_lookup" Then
            Item.Click
        End If
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
In what way does it not let you complete the form?

Are you not able to enter the dates at all?

Or are you able to enter the dates you want but when you try to submit the form it doesn't allow you, perhaps telling you there's a missing entry or similar?
 
Upvote 0
Hi,

I am able to enter the dates in the form.
But when trying to submit it says that the start date is not correct.
I initailly tried to do this with imacro - even there it was giving me an error.

Thanks in advance
 
Upvote 0
That could be for a no of reasons, really hard to tell without seeing the page I'm afraid.
 
Upvote 0

Forum statistics

Threads
1,224,605
Messages
6,179,860
Members
452,948
Latest member
UsmanAli786

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top