PDA

View Full Version : Website automation by VBA



uroy
05-22-2015, 05:12 PM
Hi All,

I want to download a file from a protected site and I do not know how to create a data connection with that file URL.

So, I am looking for a vba code which will be automatically login to that website with the given Username and Password after that it will download that given file from the file URL.

I am not disclosing the website name and file URL for the security issue. I have attached the websites HTML source code with this post.

Find the attachment for the source code. If I need to add any library object into reference list then let me know.

Thanks & Regards
Uday Roy

uroy
05-23-2015, 02:21 AM
Sub FillInternetForm()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
'create new instance of IE. use reference to return current open IE if
'you want to use open IE window. Easiest way I know of is via title bar.
IE.Navigate "https://my.statestreet.com/main-smpwservices.fcc?TYPE=33554433&REALMOID=06-f72cbc6c-9bc7-10c7-a00b-84ad5e2a0cb3&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=-SM-w5TPnAFpWAGsLHoLx%2bnHxDh3X0%2fT2i9cQ05ZHNG703PZh0EvZVcKSepvZ560nCdZ&TARGET=-SM-https%3a%2f%2fmy%2estatestreet%2ecom%2flogin%2fhome"


'go to web page listed inside quotes
IE.Visible = True
While IE.busy
DoEvents 'wait until IE is done loading page.
Wend
IE.document.all("LOGIN").Click


End Sub

SamT
05-23-2015, 08:57 AM
Is the problem solved?
If it is, you can use the Thread Tools menu to mark it solved.
Thanks.

uroy
05-23-2015, 11:33 AM
No, It is not solved. I am waiting for reply.

SamT
05-23-2015, 11:55 AM
What about that code, Sub FillInternetForm()? What is it doing or not doing for you?

While I don't have any experience with VBA & IE, I can tell that those who do, will need you to be more expansive with your information.

For example, we have strict rules about helping "bad guys" do "bad things", so we are very leery of anything that looks the least bit "bad."

Tell us about your relation to this "Protected Site" and why you won't even mention its name?

uroy
05-23-2015, 01:02 PM
What about that code, Sub FillInternetForm()? What is it doing or not doing for you?

While I don't have any experience with VBA & IE, I can tell that those who do, will need you to be more expansive with your information.

For example, we have strict rules about helping "bad guys" do "bad things", so we are very leery of anything that looks the least bit "bad."

Tell us about your relation to this "Protected Site" and why you won't even mention its name?