Excel WebQuery Login Problem using Office 365

focuswiz

New Member
Joined
Aug 12, 2014
Messages
20
I have been reading this board for a long time and never needed to post a question since it had already been asked/covered by someone before me. In the meantime, I have learned a lot, so I will start with a "Thank you" for all the posts that helped me learn.

I have a question that I have not seen asked previously, so hopefully someone will know what I am doing wrong and set me straight. I am just past the beginner stages with Excel. I have used pivot tables and indirect references and table lookups and date and time computations and lots of conditional formatting, but have never learned any of the more advanced features.

First of all, I am definitely unclear how a web query works and how it relates to a normal Internet Explorer session. They seem to share some information but not other things. For example, my homepage carries over and many of the recent sites visited in Internet Explorer seem to be available in the dropdown for the Web Query. However, if I log into a website in Internet Explorer, that login does not persist to an Excel WebQuery. If there is something somewhere that explains how these two should work, I would be glad to do some reading. Most of what I have done is based on threads here and elsewhere along with trial and error.

Here is some background....

I have a series of spreadsheets which were built in Excel 2010 which have been working (at least with regard to this topic) for over a year. These spreadsheets use data from a web query to populate tables and perform computations & projections based on a variety of data. One of the websites I use requires a login. Though I have never been able to automate that login process, what I have done is choose Data, Get External Data, From Web, and then access the website and log in. The login persists throughout the Excel session. I can close spreadsheets and open new ones and run the same queries without performing a new login as long as I do not close Excel. If I open another instance of Excel, I must log in again there, but within each instance of Excel, I have not seen the need to log in more than once (unless there is an abend of some kind). I run several similar macro-enabled Workbooks at the same time, with the macros repeating about once a minute during certain hours. Since they are running the same macros and queries I run each in a separate Excel Instance to avoid conflicts. This is the behavior in Excel 2010 and it is working fine (or at least reasonably well).

My newer machine has a subscription to Office 365 which I believe uses Excel 2013. This version of Excel is a bit different. Initially, I had difficulty creating multiple Excel Instances, but am now quite comfortable doing that. Thus, I run multiple copies of my spreadsheets, each in an instance and it works to some extent, but not as reliably as it does in the older Excel version.

Here is my problem:

The login does not persist to the same degree it did in Excel 2010. I was not clear what was causing me problems when I first started using the new version (first I had problems running multiple instances and then I was unsure if the website itself was having problems). However, I was able to work with up to 3 simultaneous Workbooks running and logged into a website, retrieving and reporting data. I was not sure why an attempt at a 4th instance failed, but had attributed it to human error (i.e., maybe I forgot to log in first). I am now not so sure.

A couple of days ago, I tried to run three instances of Excel as described above on the newer machine and two worked, but the third did not. I realized I must have forgotten to log in. I logged in, ran the macros and they failed as if I had not logged in. I returned to the start page (which is different when logged in) and it had a login prompt again. I logged in again (definitely successful), but did not start the macros. Instead, I returned to the start page....it was prompting still for login credentials. I went to one of the two workbooks that were running successfully. I logged out and logged back in and returned to the start page and saw that I remained logged in. Doing it side-by-side with one of the working and with the non-working instance, they were both consistent in their behavior; for one the login always persisted, for the other it never persisted. I shut down the third instance and restarted it (several times), it would no longer retain my login.

I closed the nonworking spreadsheet and ran it on one of the other two machines (Running Window 7 Ultimate or Professional) using Excel 2010 where I was able to keep as many as five instances running on each with no problem.

Yesterday, I tried the new machine (Windows 8.1 Professional with latest update) again and could not get even one instance of Excel to retain the login information. I closed things up and went to Internet Explorer to clear every kind of cache and history (remember, I said I do not know the relationship between Internet Explorer and the browser within Excel which looks a lot like Internet Explorer). Closing, opening, restarting, shutting down the machine, restarting Windows, nothing seemed to affect this behavior.

Today, thinking it might be related to the website I am using, I decided to try something more generic. I created a web query session on an old machine (Win7 & Excel 2010) and the new one (Win8 & Excel 2013). I went to mail.yahoo.com on each and successfully logged in and saw my messages. On each machine, I then closed the browser window and re-opened it. In the older environment, the login persisted and I was brought straight to my inbox list of emails. In the newer environment it has lost my login and I had to re-login. I want the login to persist in the newer environment as it had orginally and as it seems to do better in the older environment, but I do not know what I need to do to fix this.

I am unsure if I have adequately explained what I am looking for, but is there some setting or option that I need to change or is there some cache that needs to be cleared to change this behavior back? The odd thing was the three Excel instances where one worked differently a few days ago. It looks like something got filled up or corrupted.

I could post the (copious) VBA code, but I don't think this is a coding issue since I can reproduce the problem with a blank worksheet that has no macros and with a fairly generic email login as described.

Any ideas from someone who has a clue? I am totally clueless here.

Thank you.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Still no luck trying to resolve this. I have cleaned out everything in the IE cache and I have tried both the Quick Repair and the Online Repair options for Office 365. I cannot get the behavior back to being as restricted as it was a couple of weeks ago (when three instances would stay logged in). Not even a single instance can retain its login. Any ideas what I need to change?

Thanks.
 
Upvote 0
Okay, having given up on thinking it was an Office 365 issue, I tried resetting Internet Explorer to its defaults and that had absolutely no effect either, but I continued to believe tha this may be an Internet Explorer issue (though I am still not sure how the "full" Internet Explorer relates to the web query browser).

Here is how this seems to have been resolved:

  1. I opened up a regular Internet Explorer session (outside of Excel and with Excel closed (though I doubt the latter item matters).
  2. In IE, I chose "Tools / Internet Options.
  3. In the Privacy Tab, I clicked on the "Advanced" button under "settings"" to get to the "Advanced Privacy Settings" dialogue.
  4. I checked the box to "Override automatic cookie handling."
  5. I left First-party cookis and Third-Party cookies alone (both were set to "Accept") and checked the box for "Always allow session cookies."
This seemed to allow the login cookie to persist after the browser window was closed.

The settings are not set this way on either Windows 7 machine and these settings were never set this way on the Windows 8 machine before today (I had checked to make sure that these settings were similar to my other machines when I first started using it).

I am at a loss as to explain how it ever worked before and/or why it works on the other machines and/or why it stopped working on this machine. I will post again if I find that this fix is not permanent.

Thanks for anyone who tried to understand this issue or thought about what might be done to fix it. If anyone has any insight into this problem now that there appears to be a change that affected this (or the relationship between Internet Explorer and the version of it used for Web Queries) I am still interested in learning more (especially if you can explain why it used to work on this machine and continues to work (for over a year) on the other two machines.
 
Upvote 0
This was not as resilient as I had hoped. I came back a few minutes later and it had lost its login again. I am now trying it with the separate Internet Explorer window open while the macro is running in Excel. I will watch it and see if there is any pattern to when the login gets lost again.
 
Upvote 0
Latest symptoms...

Here is the latest behavior (I think).

If I have Internet Explorer open with the "Override automatic cookie handling" option checked and I log into the website via the Excel Web Query, it appears to stay logged in. If I just use the Excel Web Query (without Internet Explorer), I can log into the website via the Excel Web Query but it will not be logged in the next time it attempts to communicate with the website.

If I start the query running successfully as described above (it runs through several queries and then repeat over and over) and leave it running and then come back later and close Internet Explorer, the query continues to run fine.

I find this quite confusing and nonintuitive.

Does anyone have a clue as to what I should be looking at here? I am dumbfounded. I only see this issue on the Windows 8 machine with Office 365. All three machines are running the same Internet Security (Norton Internet Security) and none of this jockeying around needs to be done to have this run on any of my other machines (nor on this one a few weeks ago).

Thanks.
 
Upvote 0
Re: Latest symptoms...

Not sure that anyone is interested, but at least, for me, I am tracking what has and has not been attempted since I first posted this.

Reading through Steve Gibson's site, I came across this note:
For Always allow session cookies: This should always be disabled (not checked). Accepting first-party cookies includes accepting first-party session cookies, so web sites that require your browser to carry a temporary session cookie will operate without trouble.

transpixel.gif

But since "Always allowing session cookies" includes third-party session cookies — which is NOT what we want — leaving this option disabled is the only way to completely block both persistent and non-persistent third-party cookies.

transpixel.gif

The only time you might want to always allow session cookies would be if you were not always accepting all first-party cookies.
Thus, I have decided to discard that alterative. At some point, I may change it to only allow First Party cookies, but as noted earlier, that solution was quite quirky and I was not 100% comfortable that I understood how "jumpstarting" the session outside of Excel was helping the process work.

In reading about some recent issues (and successes) with IE11, it appears that Microsoft has attempted to make its browser more compatible with websites that do not like MSIE. In other words, Microsoft is now trying to make its browser look less like Internet Explorer than before to websites.

My latest attempt at a fix is to include the websites causing a problem to the Compatibility View list. In a brief test today, this seems to have eliminated the problem, though I definitely need to do more testing.

I am not sure why this need came about. I performed Windows Updates to this machine in mid-July and mid-August, but the problems started getting worse between those dates, not coincident with either. I am now applying updates to one of my Windows 7 machines which runs IE11 to see if I now start having the problem there.

Will try testing this week to see if my problem has been resolved.
 
Upvote 0
Re: Latest symptoms...

Hello,

I feel the same issue now. Were you able to get it fixed on your Excel 365 ? Please let me know.

Thanks
 
Upvote 0
Re: Latest symptoms...

Sadly, no.

What I have been doing is to first open Internet Explorer outside of Excel and to then leave that open and minimized outside of Excel while running the macros. Thus, I open Internet Explorer (which uses a Google search as its home page) and leave it where it opens and then open each Excel instance and log in there. For some reason, this seems to work. It is almost as if I have used the "Delete Browsing History on Exit" option selected (which I don't). Keeping another instance open all the time seems to prevent the problem, but I have accidentally closed this without encountering a problem also. It seems that as long as Internet Internet Explorer is recently running (there seems to be a minute or two grace period) I do not have the problem.

I wish I could at least understand what causes this. If you have any insight or develop any theories, please post them here and maybe someone who knows this product better than I (I am just a novice) can help us.
 
Upvote 0

Forum statistics

Threads
1,214,907
Messages
6,122,181
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top