Solved

Access secure website to download flat text files

Posted on 2004-04-05
5
359 Views
Last Modified: 2010-05-02
I am trying to automate accessing a secure website in order to download three flat text files using VB's webbrowser control. I want to do this all behind the scenes because the operators for this application or not savvy enough to enter id's and passwords and download the files themselves.

The website requires an organization id, a password, and a selection of being a downloader (yes) or a representative (no) in the form of a radial/option button. Onces these items are filled in and seleted, then the user will typically click the Login button which will take them to the secure site to download the files.

From that point there is another selection process (selecting to download "all files" or files individually). And then the dialog box asking to open or save will come up (I want this hidden as well). I want to save to the local PC and then exit the site.

Any good places I can look for this information on "how-to" or any suggestions?

Thank you!
0
Comment
Question by:brownkj1
  • 3
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
aelatik earned 500 total points
ID: 10760429
You can use the Internet Explorer to navigate to that website in invisible mode and do your thing.

You navigate through it like this :

        Dim IE
        Set IE = CreateObject("InternetExplorer.Application")
        IE.Navigate "http://www.go.com.mt/mygo/index.jsp"
        IE.Visible = True
        While IE.Busy
        DoEvents
        Wend
        IE.Document.All("msisdn").Value = "mynumber" ' contains the HTML name of the object
        IE.Document.All("password").Value = "mypassword" ' contains the HTML name of the object
        IE.Document.All("my_go_login").submit ' contains the HTML name of the object
0
 

Author Comment

by:brownkj1
ID: 10760800
Okay, all of that works great and I'm on the last leg of getting this completed (THANK YOU). One last question if you don't mind???

I am on the last step where I have to download the file itself. Problem is a dialog box pops up and says, "Open, Save To Disk, Cancel". I need this to be invisible as well and done behind the scenes. Would you be able to offer some suggestions on that as well?




0
 
LVL 14

Expert Comment

by:aelatik
ID: 10761004
Thats a difficult part, you can't hide it directly. But you can wait till it starts loading and then hide it. Try this out. ( I can't think of an other method )

        Dim IE
        Dim objShell
        Dim objShellWindows
        Set objShell = CreateObject("Shell.Application")
        Set objShellWindows = objShell.Windows
        Set IE = CreateObject("internetexplorer.application")
        Dim Done
            Done = False
        Do Until Done = True
        For Each IE In objShellWindows
            If LCase(IE.LocationURL) = "http://www.google.nl/" Then
                IE.Visible = True
                Done = True
            End If
        Next
        Loop
0
 

Author Comment

by:brownkj1
ID: 10761149
Is there no way to use the Silent property on the IE object? I can set Silent to true but I'm not sure how I can get to the "Save As" and save the actual file from there.

This doesn't open as a website, it opens as a file "save as" dialog box, therefore I don't think I can use the above scenario.

0
 

Author Comment

by:brownkj1
ID: 10761239
I am going to go ahead and give you the points for the answer you provided, which was excellant, to help me with my first and main problem. I will reopen the second issue as another question (which you're more than welcome to help on as well).

I think that would be fair, more so than making you answer two questions for one set of points!

Thanks again!
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

773 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