KieronShaw
MIS
Hi Guys,
First of all apologies if this specific question has been asked elsewhere, I did a search but was unable to find anything that matches my requirements exactly.
I am new to Tek-Tips & fairly new to Visual basic, I have been playing around for a few months now but have only just taken the time to look into the possibilities.
My question is very simple I'm sure but as a complete novice who has gotten where he is with trial & error & a little bit of luck I've hit a bit of a stumbling block. Please find my Script below:
As you can see this script essentially opens a web page & navigates to a page, logs in, navigates to a specific page & then 'Exports/Downloads' a document based on criteria embeded in the final URL.
This then opens the document in excel (normally under the name 'inbox.do' but this is not always the case), what I'm then required to do is save the document (name/location unimportant at the moment) so that I can then reference it in a later Excel document.
As I said I'm sure it's very easy to do but I'm struggling to get it to work!
Many thanks in Advance
First of all apologies if this specific question has been asked elsewhere, I did a search but was unable to find anything that matches my requirements exactly.
I am new to Tek-Tips & fairly new to Visual basic, I have been playing around for a few months now but have only just taken the time to look into the possibilities.
My question is very simple I'm sure but as a complete novice who has gotten where he is with trial & error & a little bit of luck I've hit a bit of a stumbling block. Please find my Script below:
Code:
Set IE = CreateObject("InternetExplorer.Application")
set WshShell = WScript.CreateObject("WScript.Shell")
IE.Navigate "[URL unfurl="true"]http://172.19.70.3/ccc/login.do?action=welcomeLogin"[/URL]
IE.Visible = True
Wscript.Sleep 1000
IE.Document.loginform.userid.Value = "********"
IE.Document.loginform.password.Value = "**********"
WshShell.AppActivate "IE"
WshShell.SendKeys "{ENTER}"
IE.Navigate "[URL unfurl="true"]http://172.19.70.3/ccc/contextSwitch.do?action=searchACOSCustomer"[/URL]
IE.Navigate "[URL unfurl="true"]http://172.19.70.3/ccc/inbox.do?hdnAction=initialScreenDisplay"[/URL]
IE.Navigate "[URL unfurl="true"]http://172.19.70.3/ccc/inbox.do?hdnAction=exportToExcel&event=excel&origin=-1&email1=&forename=&surname=&workgroup=-1&advisor=-1&datefrom=22/08/2011&dateto=23/08/2011&num=&status=1&calldatetype=-1"[/URL]
As you can see this script essentially opens a web page & navigates to a page, logs in, navigates to a specific page & then 'Exports/Downloads' a document based on criteria embeded in the final URL.
This then opens the document in excel (normally under the name 'inbox.do' but this is not always the case), what I'm then required to do is save the document (name/location unimportant at the moment) so that I can then reference it in a later Excel document.
As I said I'm sure it's very easy to do but I'm struggling to get it to work!
Many thanks in Advance