Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel calling IE as a child window

Status
Not open for further replies.

jelly2

Programmer
Jul 14, 2003
1
SI
I have an Excel file (and a VBA macro) from which I would like to call (Shell command) Internet Explorer, on the url I have attached data that I get from Excel file.
We have a server-side application that generates some data. When the user follows a link the browser Window should close and the user returnes to his Excel file.
The problem is that if I know correctly, you can not close a main window without geting a prompt. As I know you can only do that with a child window (as created with JavaScript).

So i wonder if there is a way to call a child window from VBA in Excel?
 
I'm not sure this applies to what your trying to do, but...

I once wrote a VBScript that retrieved data from a specific web-site that dynamically wrote HTML to a child-window that the web-site opened. Since it opened the child-window, I couldn't close it without getting the prompt. The solution was to pre-open a window with the same window name that the JavaScript code used. Since the VBScript opened it, it "owned" it, and I was able to close the window without a problem.

If this doesn't solve the problem, another tact I use is to add a user-form to Excel, and add a reference to "Microsoft Internet Controls". I never show the user form, but I can access different websites, and parse the data I need. You have a lot more control this way than using the shell command.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top