PDA

View Full Version : Help on Shell and Class module



rbs_logesh
02-25-2014, 12:26 AM
Hi All,

I would like to learn the shell and class module concept on VBA excel. Request any one to share the material if they have regarding this!

I want to control one of pop-up or file save dialog box that was appeared after performed an activity on web page. I do not want to control by using send keys and windows script. I would required some realiable way of coding to do this activity i.e it should wait for the pop-up and do the action.

Thanks in advance

westconn1
02-25-2014, 03:51 AM
your description of your requirement is not at all clear, you can try like this to see if it is of any help, you may need to change dialog names and other stuff







Do Until hwnd
hwnd = FindWindow(vbNullString, "File Download")
DoEvents
Loop
Do Until hchildwnd
hchildwnd = FindWindowEx(hwnd, ByVal 0&, vbNullString, "&Open")
DoEvents
Loop
RetVal = SetForegroundWindow(hwnd)
Application.Wait (Now + TimeValue("0:00:02")) ' this value may need to be adjusted
' alternatively sleep could be used
SendMessage hchildwnd, BM_CLICK, 0, 0




you will need to seach for the declares for findwindow, findwindowex, setforegraoundwindow and sendmessage, then copy them into the general section at the top of a module

the orignal information came from
www.vbforums.com/showthread.php?671093-RESOLVED-Excel-VBA-Internet-Explorer-Download-Problem&highlight=close+saveas+dialog

where you can find the complete code, the above was just the update to fix