I have placed hyperlinks in an excel spreadsheet though my ruby-on-rails application. The links are to some privileged pages that require, After the login I am supposed to taken to the requested page. However, what happens is that after login I lang on the home page of the website. Interestingly, when I right-click the link in the excel and paste the link in the web-browser url, it works as expected. So I don't think it's my app's fault, but rather something in excel that I am missing?
My scenario is pretty much the same as this scenario: http://www.geekstogo.com/forum/topic/289186-excel-2007-hyperlink-loads-web-login-screen-not-linked-urlplease-help-me/
Check to make sure that you didn't rename the second worksheet—the one that is the target of the hyperlinks. When you create hyperlinks, each of them references the name of the worksheet you specify as the target. If you later rename the worksheet, then the hyperlinks may not work as expected.
Most likely problems with opening hyperlinks are connected with either the security restrictions of your Internet browser that doesn't allow opening pop-up windows, or with your Flash player plug-in that prevents you from opening URLs in local Flash files.
Go to Data > Queries & Connections > Edit Links. In the Source list, click the linked object that you want to update. You can select individual workbooks with Ctrl+click, or all of them with Ctrl+A. Click Update Values.
Solution: Double-click the cell or press F2 to enter the edit mode, go to the end of the URL and press the Space key. Excel will convert a text string into a clickable hyperlink.
This issue normally happens in IE and i also faced the same problem.
Solution to this is very simple
<html>
<body>
Please wait, loading your page...
<script type="text/javascript">
function getQuerystring(key) {
key = key.replace(/[\[]/,"\\\[").replace(/ [\]]/,"\\\]");
var regex = new RegExp("[\\?&]"+key+"=([^&#]*)");
var query = regex.exec(window.location.href);
return query[1];
}
window.location = window.location.protocol + "//" + window.location.host + "/" + getQuerystring('page');
</script>
</body>
</html>
The links you are constructing in excel should be modified
For e.g Old link - http://test.com/post/comments/1 New link should be - http://test.com/redirect.html?page=post/comments/1
How this works.
When user clicks a link in excel it points to redirect.html and the javascript constructs the actual URL and redirects again to proper page, user will be navigated to actual page if already logged in else redirected to Login/Home page.
Not sure it's really an answer but I had the same problem with my application.
The whole application, including the home page, is protected (I'm using Devise). So whenever a user wants to access http://myapp, it redirects him to http://myapp/users/sign_in.
I think Devise uses a 301 or a 302 to redirect to the login screens.
My finding is that links clicked in Office and opening in IE cannot accomodate this redirect (no problem when Chrome is the default browser). Does it match your setup?
Ultimately, I have found no other solution but to link directly to the sign-in page... Maybe there are other options but I'm still looking for them.
EDIT: found this article (from 2006) about a bug in Outlook which totally matches our situation. Again, not a solution, but at least an explanation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With