Maximizing 2 or more IE windows in VBA

  • I posted an answer on Maximizing IE window in VBA, on OzGrid. However when I tried to use the same code where I had 2 IE addresses, it give a variable not defined error on this line:

    Code
    1. MyValue = Application.InputBox("Only Click Ok or Cancel after your Selection!!!!!!!" & vbCrLf & _
    2. "1 = OVR Office Directory" & vbCrLf & _
    3. "2 = BBVS (Bureau of Blindness & Visual Services) Office Directory", "Vocational Services - OVR " & ActiveSheet.Name)


    I am trying to understand why it is giving the error when there are 2 or more addresses, & not on a singe address. Here is the entire code:


    Please show me what I am doing wrong & how to correct it.

  • Problem solved. I broke the 2 IE addresses down to 2 separate addresses & called them. For example I changed

    Code
    1. Case 1 'Message prior to calling the webb address. MsgBox "Please wait, while I get you the OVR web address.", vbInformation, "Vocational Services - OVR " & ActiveSheet.Name Dim ie As Object Set ie1 = CreateObject("INTERNETEXPLORER.APPLICATION") ie1.NAVIGATE "http://www.dli.pa.gov/individuals/disability-services/ovr/pages/OVR-office-directory.aspx" ie1.Visible = True apiIEsize ie.hwnd, 3


    to
    Call Career_link


    Here is the new code:

    Code
    1. MsgBox "Please wait, while I get you the OVR web address.", vbInformation, "Vocational Services - OVR " & ActiveSheet.Name Dim ie As Object Set ie = CreateObject("INTERNETEXPLORER.APPLICATION") ie1.NAVIGATE "http://www.dli.pa.gov/individuals/disability-services/ovr/pages/OVR-office-directory.aspx" ie1.Visible = True apiIEsize ie.hwnd, 3