My Blog

VBA/VB.Net/VB6–Click Open/Save/Cancel Button on IE Download window – PART I

13

Recently, while answering a question in msdn forum, I came across a question when the asker had a query on how to interact with download window which pops up.

Consider this

Open Internet explorer and navigate to

So how do we click on “Open“, “Save” or “Cancel” button?

Initially I thought that using API FindWindow, FindWindowEx and Sendmessage would be enough but soon I realized that like normal windows the download window remains unresponsive to SendMessage API. So finally I had to use a workaround and then I was able to click on the Open/Save/Cancel button.

Like you and me, we both have names, similarly windows have “handles” (hWnd), Class etc. Once you know what that hWnd is, it is easier to interact with that window.

Findwindow API finds the hWnd of a particular window by using the class name and the caption of the window (“File Download”) in this case. To test it, here is a sample code

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Dim Ret As Long

Sub Sample()
    Ret = FindWindow(vbNullString, "File Download")

    If Ret <> 0 Then
        MsgBox "Window Found"
    Else
        MsgBox "Window Not Found"
    End If
End Sub

The “Open“, “Save” and “Cancel” buttons are windows in itself but they are child windows of the main window which is “File Download“. That means each one of those will also have a hWnd :) To find the child windows, we don’t use FindWindow but use FindWindowEx. All the three buttons “Open“, “Save” and “Cancel” have the same class which is “ Button”. To test it, here is a sample code.

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long

Dim Ret As Long, ChildRet As Long

Sub Sample()
    '~~> Get the handle of the "File Download" Window
    Ret = FindWindow(vbNullString, "File Download")

    If Ret <> 0 Then
        MsgBox "Main Window Found"

        '~~> Get the handle of the Button's "Window"
        ChildRet = FindWindowEx(Ret, ByVal 0&, "Button", vbNullString)

        '~~> Check if we found it or not
        If ChildRet <> 0 Then
            MsgBox "Child Window Also Found"
        Else
             MsgBox "Child Window Not Found"
        End If
    Else
        MsgBox "Window Not Found"
    End If
End Sub

Now, how do we get the hWnd of “Open” only? To get the handle of a specified button we need to first get it’s caption so that we can then compare and see if it is the right button. For this we need to use two more API’s GetWindowText and GetWindowTextLength. See the code below.

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long

Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Private Declare Function GetWindowTextLength Lib "user32" Alias _
"GetWindowTextLengthA" (ByVal hwnd As Long) As Long

Dim Ret As Long, ChildRet As Long, OpenRet As Long
Dim strBuff As String, ButCap As String

Sub Sample()
    '~~> Get the handle of the "File Download" Window
    Ret = FindWindow(vbNullString, "File Download")

    If Ret <> 0 Then
        MsgBox "Main Window Found"

        '~~> Get the handle of the Button's "Window"
        ChildRet = FindWindowEx(Ret, ByVal 0&, "Button", vbNullString)

        '~~> Check if we found it or not
        If ChildRet <> 0 Then
            MsgBox "Child Window Found"

            '~~> Get the caption of the child window
            strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
            GetWindowText ChildRet, strBuff, Len(strBuff)
            ButCap = strBuff

            '~~> Loop through all child windows
            Do While ChildRet <> 0
                '~~> Check if the caption has the word "Open"
                '~~> For "Save" or "Cancel", replace "Open" with
                '~~> "Save" or "Cancel"
                If InStr(1, ButCap, "Open") Then
                    '~~> If this is the button we are looking for then exit
                    OpenRet = ChildRet
                    Exit Do
                End If

                '~~> Get the handle of the next child window
                ChildRet = FindWindowEx(Ret, ChildRet, "Button", vbNullString)
                '~~> Get the caption of the child window
                strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
                GetWindowText ChildRet, strBuff, Len(strBuff)
                ButCap = strBuff
            Loop

            '~~> Check if we found it or not
            If OpenRet <> 0 Then
                MsgBox "The Handle of Open Button is : " & OpenRet
            Else
                MsgBox "The Handle of Open Button was not found"
            End If
        Else
             MsgBox "Child Window Not Found"
        End If
    Else
        MsgBox "Window Not Found"
    End If
End Sub

Now we have the handle of the Button that we need. So how do we click it? Under normal circumstances, the following code would have worked but like I mentioned earlier, the IE window remains unresponsive to the SendMessage API and hence the below code will not work as desired.

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long

Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Private Declare Function GetWindowTextLength Lib "user32" Alias _
"GetWindowTextLengthA" (ByVal hwnd As Long) As Long

Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long

Const BM_CLICK = &HF5&

Dim Ret As Long, ChildRet As Long, OpenRet As Long
Dim strBuff As String, ButCap As String

Sub Sample()
    '~~> Get the handle of the "File Download" Window
    Ret = FindWindow(vbNullString, "File Download")

    If Ret <> 0 Then
        MsgBox "Main Window Found"

        '~~> Get the handle of the Button's "Window"
        ChildRet = FindWindowEx(Ret, ByVal 0&, "Button", vbNullString)

        '~~> Check if we found it or not
        If ChildRet <> 0 Then
            MsgBox "Child Window Found"

            '~~> Get the caption of the child window
            strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
            GetWindowText ChildRet, strBuff, Len(strBuff)
            ButCap = strBuff

            '~~> Loop through all child windows
            Do While ChildRet <> 0
                '~~> Check if the caption has the word "Open"
                '~~> For "Save" or "Cancel", replace "Open" with
                '~~> "Save" or "Cancel"
                If InStr(1, ButCap, "Open") Then
                    '~~> If this is the button we are looking for then exit
                    OpenRet = ChildRet
                    Exit Do
                End If

                '~~> Get the handle of the next child window
                ChildRet = FindWindowEx(Ret, ChildRet, "Button", vbNullString)
                '~~> Get the caption of the child window
                strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
                GetWindowText ChildRet, strBuff, Len(strBuff)
                ButCap = strBuff
            Loop

            '~~> Check if we found it or not
            If OpenRet <> 0 Then
                MsgBox "The Handle of Open Button is : " & OpenRet
                '~~> Click the button using Send Message
                SendMessage OpenRet, BM_CLICK, 0, 0
            Else
                MsgBox "The Handle of Open Button was not found"
            End If
        Else
             MsgBox "Child Window Not Found"
        End If
    Else
        MsgBox "Window Not Found"
    End If
End Sub

Since SendMessage refuses to work, we have to find an alternative. The alternative is to programmatically position your mouse cursor over that button and then click it.

To do this we need few more APIs. They are SetWindowPos, SetCursorPos, GetWindowRect, Sleep and mouse_event.

Now when you use this code, it works perfectly. I have commented the code so that you will not have any problem understanding it.

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
(ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, _
ByVal lpsz2 As String) As Long

Private Declare Function GetWindowText Lib "user32" Alias "GetWindowTextA" _
(ByVal hwnd As Long, ByVal lpString As String, ByVal cch As Long) As Long

Private Declare Function GetWindowTextLength Lib "user32" Alias _
"GetWindowTextLengthA" (ByVal hwnd As Long) As Long

Private Declare Sub SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal _
hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As _
Long, ByVal cy As Long, ByVal wFlags As Long)

Private Declare Function SetCursorPos Lib "user32" _
(ByVal X As Integer, ByVal Y As Integer) As Long

Private Declare Function GetWindowRect Lib "user32" _
(ByVal hwnd As Long, lpRect As RECT) As Long

Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

Private Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Long, _
ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)

'~~> Constants for pressing left button of the mouse
Private Const MOUSEEVENTF_LEFTDOWN As Long = &H2
'~~> Constants for Releasing left button of the mouse
Private Const MOUSEEVENTF_LEFTUP As Long = &H4

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40

Dim Ret As Long, ChildRet As Long, OpenRet As Long
Dim strBuff As String, ButCap As String
Dim pos As RECT

Sub Sample()
    '~~> Get the handle of the "File Download" Window
    Ret = FindWindow(vbNullString, "File Download")

    If Ret <> 0 Then
        MsgBox "Main Window Found"

        '~~> Get the handle of the Button's "Window"
        ChildRet = FindWindowEx(Ret, ByVal 0&, "Button", vbNullString)

        '~~> Check if we found it or not
        If ChildRet <> 0 Then
            MsgBox "Child Window Found"

            '~~> Get the caption of the child window
            strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
            GetWindowText ChildRet, strBuff, Len(strBuff)
            ButCap = strBuff

            '~~> Loop through all child windows
            Do While ChildRet <> 0
                '~~> Check if the caption has the word "Open"
                '~~> For "Save" or "Cancel", replace "Open" with
                '~~> "Save" or "Cancel"
                If InStr(1, ButCap, "Open") Then
                    '~~> If this is the button we are looking for then exit
                    OpenRet = ChildRet
                    Exit Do
                End If

                '~~> Get the handle of the next child window
                ChildRet = FindWindowEx(Ret, ChildRet, "Button", vbNullString)
                '~~> Get the caption of the child window
                strBuff = String(GetWindowTextLength(ChildRet) + 1, Chr$(0))
                GetWindowText ChildRet, strBuff, Len(strBuff)
                ButCap = strBuff
            Loop

            '~~> Check if we found it or not
            If OpenRet <> 0 Then
                MsgBox "The Handle of Open Button is : " & OpenRet

                '~~> Retrieve the dimensions of the bounding rectangle of the
                '~~> specified window. The dimensions are given in screen
                '~~> coordinates that are relative to the upper-left corner of the screen.
                GetWindowRect OpenRet, pos

                '~~> Move the cursor to the specified screen coordinates.
                SetCursorPos (pos.Left - 10), (pos.Top - 10)
                '~~> Suspends the execution of the current thread for a specified interval.
                '~~> This give ample amount time for the API to position the cursor
                Sleep 100
                SetCursorPos pos.Left, pos.Top
                Sleep 100
                SetCursorPos (pos.Left + pos.Right) / 2, (pos.Top + pos.Bottom) / 2

                '~~> Set the size, position, and Z order of "File Download" Window
                SetWindowPos Ret, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
                Sleep 100

                '~~> Simulate mouse motion and click the button
                '~~> Simulate LEFT CLICK
                mouse_event MOUSEEVENTF_LEFTDOWN, (pos.Left + pos.Right) / 2, (pos.Top + pos.Bottom) / 2, 0, 0
                Sleep 700
                '~~> Simulate Release of LEFT CLICK
                mouse_event MOUSEEVENTF_LEFTUP, (pos.Left + pos.Right) / 2, (pos.Top + pos.Bottom) / 2, 0, 0
            Else
                MsgBox "The Handle of Open Button was not found"
            End If
        Else
             MsgBox "Child Window Not Found"
        End If
    Else
        MsgBox "Window Not Found"
    End If
End Sub

Similarly, you can click on “Save” button and save the file to a location of your choice. This mean, you have to repeat the process of FindWindow, FindWindowEx with “Save As” window.

If it is just a matter of saving a file to a desired location then there is a different API altogether which is URLDownloadToFile. I would recommend using this as it is not painful as above.

Option Explicit

Private Declare Function URLDownloadToFile Lib "urlmon" _
Alias "URLDownloadToFileA" (ByVal pCaller As Long, _
ByVal szURL As String, ByVal szFileName As String, _
ByVal dwReserved As Long, ByVal lpfnCB As Long) As Long

Dim Ret As Long

Sub Sample()
    Dim strURL As String
    Dim strPath As String

    '~~> URL of the Path
    strURL = "http://spreadsheetpage.com/downloads/xl/king-james-bible.zip"
    '~~> Destination for the file
    strPath = "E:UsersSiddharth RoutDesktopking-james-bible.zip"

    Ret = URLDownloadToFile(0, strURL, strPath, 0, 0)

    If Ret = 0 Then
        MsgBox "File successfully downloaded"
    Else
        MsgBox "Unable to download the file"
    End If
End Sub

The code above will work in VBA and VB6.

VB.NET CODE

a) Code to Click the Buttons

Imports System.Runtime.InteropServices
Imports System.Text

Public Class Form1
    Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
    (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer

    Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" _
    (ByVal hWnd1 As Integer, ByVal hWnd2 As Integer, ByVal lpsz1 As String, _
    ByVal lpsz2 As String) As Integer

    <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
    Private Shared Function GetWindowText(ByVal hwnd As IntPtr, ByVal lpString As StringBuilder, ByVal cch As Integer) As Integer
    End Function

    <DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
    Private Shared Function GetWindowTextLength(ByVal hwnd As IntPtr) As Integer
    End Function

    Private Declare Sub SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal _
    hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal cx As _
    Integer, ByVal cy As Integer, ByVal wFlags As Integer)

    Private Declare Function SetCursorPos Lib "user32.dll" ( _
    ByVal X As Int32, ByVal Y As Int32) As Boolean

    <DllImport("user32.dll")> _
    Private Shared Function GetWindowRect(ByVal HWND As Integer, ByRef lpRect As RECT) As Boolean
    End Function

    Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Integer)

    Private Declare Sub mouse_event Lib "user32.dll" (ByVal dwFlags As Integer, _
    ByVal dx As Integer, ByVal dy As Integer, ByVal cButtons As Integer, ByVal dwExtraInfo As Integer)

    '~~> Constants for pressing left button of the mouse
    Private Const MOUSEEVENTF_LEFTDOWN As Integer = &H2
    '~~> Constants for Releasing left button of the mouse
    Private Const MOUSEEVENTF_LEFTUP As Integer = &H4

    <StructLayout(LayoutKind.Sequential)> Public Structure RECT
        Dim Left As Integer
        Dim Top As Integer
        Dim Right As Integer
        Dim Bottom As Integer
    End Structure

    Const HWND_TOPMOST = -1
    Const HWND_NOTOPMOST = -2
    Const SWP_NOSIZE = &H1
    Const SWP_NOMOVE = &H2
    Const SWP_NOACTIVATE = &H10
    Const SWP_SHOWWINDOW = &H40

    Dim Ret As Integer, ChildRet As Integer, OpenRet As Integer
    Dim strBuff As String, ButCap As String
    Dim pos As RECT

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        '~~> Get the handle of the "File Download" Window
        Ret = FindWindow(vbNullString, "File Download")

        If Ret <> 0 Then
            MessageBox.Show("Main Window Found")

            '~~> Get the handle of the Button's "Window"
            ChildRet = FindWindowEx(Ret, 0, "Button", vbNullString)

            '~~> Check if we found it or not
            If ChildRet <> 0 Then
                MessageBox.Show("Child Window Found")

                '~~> Get the caption of the child window
                ButCap = GetText(ChildRet)

                '~~> Loop through all child windows
                Do While ChildRet <> 0
                    '~~> Check if the caption has the word "Open"
                    '~~> For "Save" or "Cancel", replace "Open" with
                    '~~> "Save" or "Cancel"
                    If InStr(1, ButCap, "Open") Then
                        '~~> If this is the button we are looking for then exit
                        OpenRet = ChildRet
                        Exit Do
                    End If

                    '~~> Get the handle of the next child window
                    ChildRet = FindWindowEx(Ret, ChildRet, "Button", vbNullString)
                    '~~> Get the caption of the child window
                    ButCap = GetText(ChildRet)
                Loop

                '~~> Check if we found it or not
                If OpenRet <> 0 Then
                    MessageBox.Show("The Handle of Open Button is : " & OpenRet)

                    '~~> Retrieve the dimensions of the bounding rectangle of the
                    '~~> specified window. The dimensions are given in screen
                    '~~> coordinates that are relative to the upper-left corner of the screen.
                    GetWindowRect(OpenRet, pos)

                    '~~> Move the cursor to the specified screen coordinates.
                    SetCursorPos((pos.Left - 10), (pos.Top - 10))
                    '~~> Suspends the execution of the current thread for a specified interval.
                    '~~> This give ample amount time for the API to position the cursor
                    Sleep(100)
                    SetCursorPos(pos.Left, pos.Top)
                    Sleep(100)
                    SetCursorPos((pos.Left + pos.Right) / 2, (pos.Top + pos.Bottom) / 2)

                    '~~> Set the size, position, and Z order of "File Download" Window
                    SetWindowPos(Ret, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE)
                    Sleep(100)

                    '~~> Simulate mouse motion and click the button
                    '~~> Simulate LEFT CLICK
                    mouse_event(MOUSEEVENTF_LEFTDOWN, (pos.Left + pos.Right) / 2, (pos.Top + pos.Bottom) / 2, 0, 0)
                    Sleep(700)
                    '~~> Simulate Release of LEFT CLICK
                    mouse_event(MOUSEEVENTF_LEFTUP, (pos.Left + pos.Right) / 2, (pos.Top + pos.Bottom) / 2, 0, 0)
                Else
                    MessageBox.Show("The Handle of Open Button was not found")
                End If
            Else
                MessageBox.Show("Child Window Not Found")
            End If
        Else
            MessageBox.Show("Window Not Found")
        End If

    End Sub

    Public Function GetText(ByVal hWnd As IntPtr) As String
        Dim length As Integer
        If hWnd.ToInt32 <= 0 Then
            Return Nothing
        End If
        length = GetWindowTextLength(hWnd)
        If length = 0 Then
            Return Nothing
        End If
        Dim sb As New System.Text.StringBuilder("", length + 1)

        GetWindowText(hWnd, sb, sb.Capacity)
        Return sb.ToString()
    End Function
End Class

b) Code to download the file

Public Class Form1
    Private Declare Function URLDownloadToFile Lib "urlmon" _
    Alias "URLDownloadToFileA" (ByVal pCaller As Integer, _
    ByVal szURL As String, ByVal szFileName As String, _
    ByVal dwReserved As Integer, ByVal lpfnCB As Integer) As Integer

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        Dim Ret As Integer
        Dim strURL As String
        Dim strPath As String

        '~~> URL of the Path
        strURL = "http://spreadsheetpage.com/downloads/xl/king-james-bible.zip"
        '~~> Destination for the file
        strPath = "E:\Users\Siddharth Rout\Desktop\king-james-bible.zip"

        Ret = URLDownloadToFile(0, strURL, strPath, 0, 0)

        If Ret = 0 Then
            MessageBox.Show("File suceesfully downloaded")
        Else
            MessageBox.Show("Unable to download the file")
        End If
    End Sub
End Class

Edit: Updated

VBA/VB.Net/VB6–Click Open/Save/Cancel Button on IE Download window – PART II

  1. Genovese
    Genovese12-16-2011

    Hi,
    Awsome code! very clear and really useful, however, I am having trouble with the on mouse click event. i can see the moues clicks, but it doesnt do anything. I mean the open button flashes but nothing actually opens. When i do it manually of course no problems, but useing the code just creates a flash and nothing more, is there something i am doing wrong?

    All advice most welcome!

    • Siddharth Rout
      Siddharth Rout12-26-2011

      Hello Genovese

      I was on holiday so was not able to reply to your comment. Few things

      1) Are you using IE or some other browser?
      2) Can you share the link that you are testing the above code with?

  2. Sandesh
    Sandesh02-02-2012

    Hi Siddharth Rout, thanks for post. My doubt is how to get name of file being downloaded or opened. I tried to open the file using send keys.Now I need to read data from that file, so i am trying to capture the file name (Here Eg:King-James-bible.xlsm). then i am reading from that workbook.

    But to capture Name i have used

    ChildRet = FindWindowEx(Ret, ByVal 0&, “Name”, vbNullString)
    MsgBox ChildRet
    still i couldnt get the file name. can you help me.

    • Siddharth Rout
      Siddharth Rout02-02-2012

      Look for my next blog post which will be up soon. The topic will be “VBA/VB.Net/VB6–Click Open/Save/Cancel Button on IE Download window – Part II” . HTH

  3. Mac
    Mac05-12-2012

    Excellent work! Thank you for the thorough explanation..

  4. Vinit Navani
    Vinit Navani06-12-2012

    This is great, but need one more help… The above does not seem to work when the computer is locked… any work around….

    • Siddharth Rout
      Siddharth Rout06-12-2012

      That is because the Parent window is not the desktop any more when you lock your screen. You have to get the hwnd of the desktop window and then enumerate the child windows of the desktop. :)

  5. Sebastian Klug
    Sebastian Klug07-12-2012

    Hi!
    Thanks for the guide and code! I’m just starting out with VB and I have some questions/problems.
    First off I get an error saying “Handles clause requires a WithEvents variable defined in the containing type or one of its base types.” Ive tried googling it without luck.

    Also, do you need to call the function in order for it to run or will it sense the window and run automatically? Is there a simple way to make it return true/false depending on outcome?

    BR
    Sebastian

    • Siddharth Rout
      Siddharth Rout07-12-2012

      When you say VB do you mean vb.net/vb6 or VBA

      • Sebastian Klug
        Sebastian Klug07-12-2012

        I’m sorry, I forgot to say that I’m using VB 2010 Express. I guess that’s VB.net.

  6. Jesse
    Jesse05-02-2013

    Siddharth – Do you have an “Open” method that works with IE 10? Not sure if Microsoft changed the name of the File Download window, but this isn’t working for me. I hit the “Window Not Found” error. Thanks –

    • Siddharth Rout
      Siddharth Rout05-02-2013

      I still have IE 9. I haven’t tested it with IE 10 yet :)

  7. samuel
    samuel12-13-2013

    thanks a lot.. this was completely a new knowledge for me.. but it clearly explains on opening and cancellin the file.. but for saving we would need to code for the next window that pops up while we click save button… and if we need to save in a specific name we wil hav to manually write.. can you give me some insight on how those can be done.. i hope am clear.. let me know if misleading (i do understand the other mode wherein we can save using the url being the input; but in my case the url is dynamically generated; so hav to go step by step process)