westconn1, once again your great suggestion lead me in the right direction. Here is the code that lets me select the file format from the dropdown list and click OK, all within the child window.. What I didn't realize until I tried your code is that it let me work with the HTML elements within the document. Thanks so much for your help!
Code:Dim sh As Object Dim wb As Object Dim ieDoc As MSHTML.HTMLDocument Dim elems As MSHTML.IHTMLElementCollection Dim e As MSHTML.IHTMLElement Set sh = CreateObject("shell.application") Set wb = sh.Windows(sh.Windows.Count - 1) Set ieDoc = wb.Document ' Select the report format from the dropdown list. Index is 0-based. ieDoc.getElementById("exportformatlist").selectedIndex = 3 ' Click the OK button. With ieDoc Set elems = .getElementsByTagName("input") For Each e In elems If ((e.getAttribute("className") = "crexportbutton") And _ e.Value = "OK") Then e.Click Exit For End If Next e End With ' Clean up. Set sh = Nothing Set wb = Nothing Set ieDoc = Nothing




Reply With Quote
