Solved

Access secure website to download flat text files

Posted on 2004-04-05
5
357 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now