+ Reply to Thread
Results 1 to 8 of 8

Web browser opens modal and looses interaction

  1. #1
    Registered User
    Join Date
    06-20-2014
    Location
    Scotland
    MS-Off Ver
    2010 & 2013 professional
    Posts
    16

    Web browser opens modal and looses interaction

    I've been scratching around on this one for a couple of months now, searching, reading and failing.

    The background is this: I use a webpage in work which allows you to set filters. when you click on the set filters, it triggers a JavaScript post back that loads the filter page in window.showmodaldialog.

    this page is a webpage using a plethora of input boxes and input submit buttons which I hoped to use the HTML Dom to enter filters then "click" OK.

    My VBA contains a web browser which loads the URL, logs in and clicks the "set filters" but the modal dialog opening is where I loose it.

    can anyone please explain to me if its possible to return the modal dialog to the object/new object so I can enter the filters and click "OK"?

    so far I've tried reading the hwnd, I can find the window I want and after that I'm a rabbit between headlights.

    thanks in advance, Dave

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Web browser opens modal and looses interaction

    Hello dgwebster,

    If the site is secure meaning you need a user name and password, it may not be possible for us to help you due to security issues.

    On the other hand, if it is public then writing your code using the MSXML2 parser might be an option. The parser allows your code to run synchronously with the web page.

    To really know whether this will work or not, I would need to either see the web page or the web page source code.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    06-20-2014
    Location
    Scotland
    MS-Off Ver
    2010 & 2013 professional
    Posts
    16

    Re: Web browser opens modal and looses interaction

    sadly it is secure and available on the corporate network/VPN only.

    I've genuinely never seen coding as bad as this webapp is done. I even dug through the HTML to see if I can navigate direct to the filter page (I can) but the use of JScript postbacks means the subsequent entered filters are useless as I'm simply navigating back to the original page, not telling it to load my results.

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Web browser opens modal and looses interaction

    Hello dgwebster,

    The postback will trigger a document load event. This is generally hit or miss when IE because it runs asynchronously from VBA. IE uses the MSXML2 parser to handle the HTML DOM. You can use this parser to access the reloaded web quite easily and control the filters etc. It does help if you have a HTML background when using the parser because it is lower level code than IE.

    I am guessing you can not post the HTML page source due to company policy.

  5. #5
    Registered User
    Join Date
    06-20-2014
    Location
    Scotland
    MS-Off Ver
    2010 & 2013 professional
    Posts
    16

    Re: Web browser opens modal and looses interaction

    My employer wouldn't give too much of a hoot, then solution vendor in the other hand...

    Im pretty fluent in HTML and associated languages including xml, will take a look at the MSXML potential

    thank you for giving me a glimmer of hope

  6. #6
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Web browser opens modal and looses interaction

    Hello dgwebster,

    Tapadh leat! You're welcome. Let me know if you need any help with the MSXML2 parser.

  7. #7
    Registered User
    Join Date
    06-20-2014
    Location
    Scotland
    MS-Off Ver
    2010 & 2013 professional
    Posts
    16

    Re: Web browser opens modal and looses interaction

    I have progress. whilst reviewing the HTML I found a separate section of code that detailed saved filters with links to open them. I have therefore been able to save a filter and recall this daily! happy chappy on that front, the remaining pop up was an iframe and I could take care of that OK.

    remaining hurdle is IE9 & the flaming "do you want to open or save" and the fact I cannot trust this internal website! flaming corporations really like makibg work easy don't they!

    I'm looking at xmlhttp to download the files that way now.

  8. #8
    Registered User
    Join Date
    06-20-2014
    Location
    Scotland
    MS-Off Ver
    2010 & 2013 professional
    Posts
    16

    Re: Web browser opens modal and looses interaction

    Best laid plans!

    After being diverted for some time, I'm back to this and to be entirely honest, trying to drive a car without any lessons on the xmlHTTP so looking for a bit of advice again. I'll give as much background as I can.

    The xl reports are listed on a page called savedreports.aspx which has a form on it. The form contains two hidden inputs (given below with example data) and uses POST method to reload the same webpage through a javascript doPostback:

    Please Login or Register  to view this content.
    I've googled the last two hours but sent myself in a loop trying to run before I walk. Any assistance in explaining or linking to logical explanation of how I can 1) submit the form (I can scrape the ASPX to get the required target & argument details) retrieve the resulting download file and save it would save me from going postal on my IT department.

    Cheers,

    Dave

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Excel Workbook Looses Proportions on Different Pc's
    By mattan in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-13-2011, 03:11 AM
  2. [SOLVED] Web hyperlinks: default browser and resulting browser window size?
    By gjh3124@yahoo.com.au in forum Excel General
    Replies: 4
    Last Post: 05-18-2006, 11:25 PM
  3. [SOLVED] Forms that are modal in 97 are not modal in 2003
    By Old Car in forum Excel General
    Replies: 2
    Last Post: 04-27-2005, 04:06 AM
  4. [SOLVED] Forms that are modal in 97 are not modal in 2003
    By Old Car in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-27-2005, 04:06 AM
  5. OpenText looses leading zeros for zip
    By Salty Dog in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-24-2005, 11:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1