Solved

Access secure website to download flat text files

Posted on 2004-04-05
5
360 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

828 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