Control Internet Explorer from VBA











up vote
0
down vote

favorite












I have created a macro/userform that creates an html file and want Internet Explorer 11 to show the page.

When you use the userform you create new data that should be shown on the page. How do I refresh the page on IE11?



I tried using meta refresh, but if the userform writes the page at the moment IE refreshes the page goes blank and stops from refreshing.



Another method I tried is sendkeys but it doesn't seem to work.



AppActivate "The page - Internet Explorer"
SendKeys "{F5}", True


nothing happens.



Are there any other options to make sure the page is refreshed and always visible? (meaning don't refresh when the file is in use by the userform)










share|improve this question




























    up vote
    0
    down vote

    favorite












    I have created a macro/userform that creates an html file and want Internet Explorer 11 to show the page.

    When you use the userform you create new data that should be shown on the page. How do I refresh the page on IE11?



    I tried using meta refresh, but if the userform writes the page at the moment IE refreshes the page goes blank and stops from refreshing.



    Another method I tried is sendkeys but it doesn't seem to work.



    AppActivate "The page - Internet Explorer"
    SendKeys "{F5}", True


    nothing happens.



    Are there any other options to make sure the page is refreshed and always visible? (meaning don't refresh when the file is in use by the userform)










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have created a macro/userform that creates an html file and want Internet Explorer 11 to show the page.

      When you use the userform you create new data that should be shown on the page. How do I refresh the page on IE11?



      I tried using meta refresh, but if the userform writes the page at the moment IE refreshes the page goes blank and stops from refreshing.



      Another method I tried is sendkeys but it doesn't seem to work.



      AppActivate "The page - Internet Explorer"
      SendKeys "{F5}", True


      nothing happens.



      Are there any other options to make sure the page is refreshed and always visible? (meaning don't refresh when the file is in use by the userform)










      share|improve this question















      I have created a macro/userform that creates an html file and want Internet Explorer 11 to show the page.

      When you use the userform you create new data that should be shown on the page. How do I refresh the page on IE11?



      I tried using meta refresh, but if the userform writes the page at the moment IE refreshes the page goes blank and stops from refreshing.



      Another method I tried is sendkeys but it doesn't seem to work.



      AppActivate "The page - Internet Explorer"
      SendKeys "{F5}", True


      nothing happens.



      Are there any other options to make sure the page is refreshed and always visible? (meaning don't refresh when the file is in use by the userform)







      vba refresh internet-explorer-11






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 20 hours ago









      QHarr

      25.7k81839




      25.7k81839










      asked 21 hours ago









      Andreas

      14.3k31441




      14.3k31441
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          We need to check your code to understand your issue, In general You can try to move this refresh code and put it after the all code in user form. so it will get executed after the execution of all user form code.






          Sub demo()

          Dim page As New InternetExplorer
          page.Navigate "www.microsoft.com"

          Do
          Loop Until page.ReadyState = READYSTATE_COMPLETE

          If Not page.Busy Or page.ReadyState = 4 Then
          page.Refresh
          End If
          page.Visible = True
          End Sub





          You can make a test with above code. If issue persist then try to provide a sample code to produce the issue.



          We will try to make a test with it and try to find a solution for it.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372041%2fcontrol-internet-explorer-from-vba%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            0
            down vote













            We need to check your code to understand your issue, In general You can try to move this refresh code and put it after the all code in user form. so it will get executed after the execution of all user form code.






            Sub demo()

            Dim page As New InternetExplorer
            page.Navigate "www.microsoft.com"

            Do
            Loop Until page.ReadyState = READYSTATE_COMPLETE

            If Not page.Busy Or page.ReadyState = 4 Then
            page.Refresh
            End If
            page.Visible = True
            End Sub





            You can make a test with above code. If issue persist then try to provide a sample code to produce the issue.



            We will try to make a test with it and try to find a solution for it.






            share|improve this answer

























              up vote
              0
              down vote













              We need to check your code to understand your issue, In general You can try to move this refresh code and put it after the all code in user form. so it will get executed after the execution of all user form code.






              Sub demo()

              Dim page As New InternetExplorer
              page.Navigate "www.microsoft.com"

              Do
              Loop Until page.ReadyState = READYSTATE_COMPLETE

              If Not page.Busy Or page.ReadyState = 4 Then
              page.Refresh
              End If
              page.Visible = True
              End Sub





              You can make a test with above code. If issue persist then try to provide a sample code to produce the issue.



              We will try to make a test with it and try to find a solution for it.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                We need to check your code to understand your issue, In general You can try to move this refresh code and put it after the all code in user form. so it will get executed after the execution of all user form code.






                Sub demo()

                Dim page As New InternetExplorer
                page.Navigate "www.microsoft.com"

                Do
                Loop Until page.ReadyState = READYSTATE_COMPLETE

                If Not page.Busy Or page.ReadyState = 4 Then
                page.Refresh
                End If
                page.Visible = True
                End Sub





                You can make a test with above code. If issue persist then try to provide a sample code to produce the issue.



                We will try to make a test with it and try to find a solution for it.






                share|improve this answer












                We need to check your code to understand your issue, In general You can try to move this refresh code and put it after the all code in user form. so it will get executed after the execution of all user form code.






                Sub demo()

                Dim page As New InternetExplorer
                page.Navigate "www.microsoft.com"

                Do
                Loop Until page.ReadyState = READYSTATE_COMPLETE

                If Not page.Busy Or page.ReadyState = 4 Then
                page.Refresh
                End If
                page.Visible = True
                End Sub





                You can make a test with above code. If issue persist then try to provide a sample code to produce the issue.



                We will try to make a test with it and try to find a solution for it.






                Sub demo()

                Dim page As New InternetExplorer
                page.Navigate "www.microsoft.com"

                Do
                Loop Until page.ReadyState = READYSTATE_COMPLETE

                If Not page.Busy Or page.ReadyState = 4 Then
                page.Refresh
                End If
                page.Visible = True
                End Sub





                Sub demo()

                Dim page As New InternetExplorer
                page.Navigate "www.microsoft.com"

                Do
                Loop Until page.ReadyState = READYSTATE_COMPLETE

                If Not page.Busy Or page.ReadyState = 4 Then
                page.Refresh
                End If
                page.Visible = True
                End Sub






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered 4 hours ago









                Deepak-MSFT

                44815




                44815






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53372041%2fcontrol-internet-explorer-from-vba%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

                    Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

                    A Topological Invariant for $pi_3(U(n))$