PDA

View Full Version : Need help getting an Excel Session to ignore .xls files from the web...(Not the usual



Pete Moss
06-16-2009, 07:29 AM
Hi. Sorry if this question has already been answered somewhere, I could not find amidst the 100s of threads for which "check the box next to 'Ignore other application'" was the answer....

My issue is: when I go to open an .xls file from the web, it DOES open in Excel even if IgnoreRemoteRequests = TRUE (and I don't want it to open the file).

Background: I have a little wannabe stand-alone program--by that I mean a macro-created hidden excel session--which accesses a particular website every X minutes and reads the sourcecode to see if any new work has been assigned to a given user. If so, it let's the user know via msgbox. So all that the user sees from this excel session is a userform, and the occasional msgbox alerting him/her of new work. The goal is for this session to NEVER open any other files (other than the one with the code that it initially opens). And yes, this hidden excel session definitely has IgnoreRemoteRequests set euqal to TRUE.

Back to the issue: The program works fine, except when this hidden excel session happens to be the oldest (or only) running excel session and the user opens a .xls file through the web. In this case, the once-hidden excel session opens this file and becomes visible. This happens (the file is opened with and is tied to this once-hidden excel session) whether or not the "Browse in same window" option is enabled for .XLS file types. I want Excel to behave the same way for files from the web as it does from, say double clicking an excel file stored on my computer in explorer mode (in which case it opens it in a "normal", visible excel session if one is runnning, and if not it starts a new "normal" session which opens the file...it never opens the file in this hidden session because it has IgnoreRemoteRequests = TRUE).

Does anyone know what I may be able to change to make this happen?

As lesser alternatives, is there a way (through VBA) to (a) make a particular excel session unable to open any files besides the ones already open, or (b) make it (though VBA) so that if any file is opened in a given excel session, it will immediately close the file and open it in a new "normal" excel session (even temporary files from the web)?

Any help is greatly appreciated; thanks in advance!

p.s. Using Excel 2003 SP2 and Windows XP