[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

IE page refresh within excel VB code

Posted on 2005-04-12
15
Medium Priority
?
432 Views
Last Modified: 2008-03-10
I have an excel workbook that will be opened by IE.  For example, right click on any excel file and do Open with Internet Explorer.

Is it possible to do a page refresh within the excel Visual Basic code?

Thanks,
Marvin
0
Comment
Question by:marvin9082
  • 7
  • 4
  • 4
15 Comments
 
LVL 1

Expert Comment

by:fiddelm3742
ID: 13810766
When i do an "open with IE"  it just opens the Excel file in a normal excel winodw.
Instead of an IE based window.  So do you just want to refresh the Excel window?
If so, what for if i might ask.
0
 
LVL 11

Expert Comment

by:turn123
ID: 13853049
Hi marvin9082 :-),
Since we haven't heard from you for a couple of days could you please give us an update on the status of this question?
See:  http://www.experts-exchange.com/help.jsp#hi51 Thank you, turn123's friendly update request script.
Offtopic comments about this script to http://www.experts-exchange.com/Applications/Q_21188389.html please :-).

~~~Turn123
0
 

Author Comment

by:marvin9082
ID: 13857144
Hi fiddelm,

I'm afraid that your observation is not correct.  Although, it seems like a normal excel window, it is not.  It is an IE window.  Please check again.  The purpose of the refresh is a bit complicated but basically, my excel documents will always be opened by IE and in order for my code to work properly, I need to constantly be doing a refresh (for example F5). Thanks!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:fiddelm3742
ID: 13858208
Well, here's my next question...
Is the refresh supposed to refresh the excel cells, or refresh the entire document (the same as closing it and re-opening it)?  I guess I dont really know what doing a refresh in IE is really doing to the excel window.
So here is my suggestion based on that fact that I dont really know what the IE Refresh is doing to the excel window in it.
Do
Application.ActiveWorkbook.RefreshAll
DoEvents
Loop

If you find this slows down your system for some reason (even with the DoEvents)  You may want to throw a pause in there.  Also this may not actually be doing the same type of "refresh" that using the IE refresh is doing, but hey  It's worth a shot.
0
 

Author Comment

by:marvin9082
ID: 13858403
I have code that provides filtering functionality.  IE COUNTRY, STATE and DISTRICT are on the template and I have combo boxes that allow users to filter on Country and State.

When a user filters on country, all of the rows that have the selected countries are thrown into an array, then all rows are hidden and then only the rows within the array are unhidden ie:

    For intK = 1 To UBound(intRows) - 1
        Rows(intRows(intK)).EntireRow.Hidden = False
    Next intK

intRows being the array that holds the selected rows.

The problem is that this excel workbook will only be opened by IE.  If I set the     'ThisWorkbook.Application.ScreenUpdating = True then it works but it is really annoying to see all of the rows hidding and unhiding individually.  If I set the ScreenUpdating = False the code still works but I have to hit F5 for the rows that where unhidden to actually be refreshed.  Hope this helps.  The above suggestion did not work.
0
 
LVL 11

Expert Comment

by:turn123
ID: 13964324
marvin9082,

Can you elaborate on why you can't just have the user open in it's own window like DrewK suggested?
http://www.experts-exchange.com/Applications/MS_Office/Excel/Q_21240455.html#12812310

If your building a website an Excel spreadsheet is the wrong tool for the job.  If your distributing the spreadsheet why can't you just allow the user to download it?  This seem an awful like your trying to screw your site together using a hammer to me.  All it leads to is frustration on your part an anyone trying to use your site.

That said have you tried hitting F5 while using your weird setup?  For me it just brings up the goto box.

http://www.experts-exchange.com/Web/Browser_Issues/Q_10161563.html looks interesting but calls for VB so I don't know how well it would work.

Turn123
0
 

Author Comment

by:marvin9082
ID: 13980932
Turn123,

Thanks for your sincere remarks.  In response, I did not build the site and have to develope around company standards.  Any engineer can criticize, it takes a real expert to find the solution or workaround.  My specialty is not VB and so I come to this forum for help.  

If you'd have read the thread you'd have noticed that I already mentioned that F5 does in fact refresh the page.  Hence the original question "Is it possible to do a page refresh within the excel Visual Basic code?"  Just in case you missed that too.

You suggestion does not apply to the issue.  

Thank you.
0
 
LVL 11

Expert Comment

by:turn123
ID: 13981274
marvin9082,

>If you'd have read the thread you'd have noticed that I already mentioned that F5 does in fact refresh the page.
Even re-reading the thread I don't see you saying F5 would do this on all the computers you need it to.  The only thing I see is "I need to constantly be doing a refresh (for example F5)." which doesn’t NOT mean that you verified that sending F5 would solve your problem.

>"Is it possible to do a page refresh within the excel Visual Basic code?"
I also saw this but I hate saying yes or no without knowing if what I'm thinking of will work for you.  But since you state that F5 works the answer is yes.

>Any engineer can criticize, it takes a real expert to find the solution or workaround.
And it takes a mind reader to do this without knowing your setup...

The basic idea of Experts Exchange is that experts (who aren't paid to help you but just do it because they enjoy it) work with you on solving your problem.  I don't like to throw out a bad solution that won't work if I can avoid it which is why I ask questions of you.  It is generally expected that you will nicely answer the questions understanding that it takes work to get a solution.

Since you answered your own question on how to refresh IE I would suggest that you post to http:Community_Support and request a refund of your points.

BTW you might ask in the VB section if you want a VB solution as most people hanging around APPLICATIONS (including myself) don't do a lot of VB coding.

Turn123
0
 
LVL 1

Accepted Solution

by:
fiddelm3742 earned 2000 total points
ID: 13981579
Well, you could always do it a very messy way.

Do
DoEvents
SendKeys "{F5}", True
Loop

However, this is going to run 100% of the time, just throwing F5's
Which probably isn't what you want.
But you might be able to tweak it to wait then refresh again later.  It's just that Excel acts weird when it's inside of IE
0
 
LVL 11

Expert Comment

by:turn123
ID: 13981630
:-)

Sleep would make the folks using this a little happier too.
0
 
LVL 1

Expert Comment

by:fiddelm3742
ID: 13981649
I didnt know if sleep if the window would actually freeze up and your processor would spike.  I have experienced that while doing things of this nature, but it's worth a shot
0
 
LVL 11

Expert Comment

by:turn123
ID: 13981717
An interesting problem.  Thanks for mentioning it fiddelm3742 :-).

I don't do much of this sort of stuff myself so Sleep hasn't caused me any headaches.  I tested F5 with Sleep two days ago before posting my comment and it seemed to work on my computer(aside from F5 not refreshing ;-)).  Not using Sleep caused Excel to be unusable though (in my test) :-(.
0
 

Author Comment

by:marvin9082
ID: 13981917
Thanks fellas.  And apologies turn123 for my remarks. They were vengeful and I regret it.  Thanks.
0
 
LVL 11

Expert Comment

by:turn123
ID: 13981960
No offence taken.  I was just trying to get a point across with my follow-up comment :-).

Turn123
0
 
LVL 11

Expert Comment

by:turn123
ID: 13982012
Oh yea...

fiddelm3742,

I have a feeling that if you posted another SendKeys solution at http://www.experts-exchange.com/Applications/MS_Office/Excel/Q_21240455.html you could pick up some more points and get that much closer to qualified PS :-).

Turn123
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Mailbox Corruption is a nightmare every Exchange DBA wishes he never has. Recovering from it can be super-hectic if not entirely futile. And though techniques like the New-MailboxRepairRequest cmdlet have been designed to help with fixing minor corr…
Today as you open your Outlook, you witness an error message: “Outlook is using an old copy of your Outlook Data File…”. Probably, Outlook is accessing an old OST file.
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question