Excel Hyperlink adding redirectURL - excel

I'm creating a hyperlink in excel
=HYPERLINK("https://www.redacted.com/index.html?Display=GroupMeetings/index","link")
When I click on this link it changes the Url to
https://www.redacted.com/index.html?redirectURL=Display%3DGroupMeetings%2Findex
if I change the URL to have ?Displayy= with two y's it does not add the redirectURL attribute. I cannot find any documentation about why this is added. Anyone know why?
The end goal is to deep launch users to specific pages within the application via a hyperlink in excel.

Do the users need to be authenticated to view the pages you are sending them to?
If so the cause may be this (taken from this answer on super user https://superuser.com/a/445431/154198):
Clicking a URL in Excel seems to open it in your default browser. But that's not really true. Before opening it in your browser, Excel first runs Microsoft Office Protocol Discovery. This uses a Windows/Internet Explorer component to determine if the URL works. (It does not identify itself as Internet Explorer, but as "User Agent: Microsoft Office Existence Discovery".) And if the results are (somehow) okay then it will open the result of that check in your default browser.
Microsoft have issued a fix for this KB218153 - which can be found here:https://support.microsoft.com/en-gb/help/218153/error-message-when-clicking-hyperlink-in-office-cannot-locate-the-inte
This may not be your specific problem, but it is at least worth knowing about.

Related

Email Attachments to SharePoint Document Library - Error

I have this weird problem when I try to use a simple default flow template to save email attachments to the company main SharePoint site: company.sharepoint.com (not subsite).
So I get started, by taking all the defaults of this flow, however, once i get to the point of providing the site address and document library path I get the error highlighted in red.
Where I get confused is that when I create a subsite like company.sharepoint.com/sites/testsite I enter the subsite address and the folder path automatically populates the folder structure for me to pick where I want to save such attachment.
I have given full owner permission to this test account with same results. So permission is not the problem.
My question is, could it be I'm using the wrong flow to save to a main SharePoint site? or this is something not allowed?
You could check the connector and recreate a new connection to SharePoint.
In many cases, an error code of 403 appears in a flow fail because of an authentication error. If you have this type of error, you can usually fix an authentication error by updating the connection, please make sure you have update the connection.
You could refer to this article.
Just in case anyone has a similar problem, the account to which you are creating a power automate flow must be a site collector to the root SharePoint site.

SeleniumBasic and Controlling Existing Edge Browser

For the past few months, I have been using SeleniumBasic with Excel and Microsoft Edge and have created some pretty useful macros for our company.
The problem I can’t seem to solve is being able to control an existing Edge/Chrome browser window that’s already open thru Excel/VisualBasic.
I have done quite a bit of searching and have found a few existing discussions regarding this subject. From what I have read and gathered, what I am trying to do is impossible with SeleniumBasic. However, there is no explanation as to why this is.
Is this just a limitation of SeleniumBasic? I understand it is fairly outdated and hasn’t been updated in a while. I know there’s code in python and java that allows you to extract existing session id through Selenium, and controlling an already open browser instance can be achieved.
I guess ultimately what I’m trying to figure out is if there is any way at all to incorporate into an excel macro coding that would allow control of an existing browser session (Chrome/Edge). Are there alternatives to SeleniumBasic that would allow me to achieve this?
Presently, my macro opens a new instance of Edge, goes to a specific website for our company (which requires login and 2FA), then once logged in, takes the data in the excel sheet and inputs the data into the site. The big annoyance here is the logging in/2FA part. Every time the macro is run, have to redo 2FA and takes up a bunch of time. Ideally would love to login just once, do the 2FA and proceed with the macro.
Anyone have any ideas/suggestions? Am I just SOL? 😅
You can't control an existing browser through SeleniumBasic.
From your description, I think you can open the browser with a specific profile as a workaround. For example, you can remember the login information in a profile, every time you open the website using that profile, it will login automatically.
To open browser with specific profile, you can refer to the following code (I test it only works with Chrome):
Public Sub Test()
Dim driver As New Selenium.ChromeDriver
'If you use the Default profile, you only need to set user-data-dir. Change the UserName to your owns
driver.AddArgument ("--user-data-dir=C:\Users\UserName\AppData\Local\Google\Chrome\User Data")
'If you use other profile, you need to set profile-directory with profile folder name
'driver.AddArgument ("profile-directory=Profile 1")
driver.Get "https://www.google.com"
driver.Wait 3000
driver.Quit
End Sub

Why are my Sharepoint Links missing the Tenant?

I am working on an automate flow that emails a share point page to a list of subscribers whenever the page is updated.
Everything works except the links contained in the email (/page). On share point i am able to navigate to the link however in the email the page redirects me to /sites/xxx/xxx.aspx. It is missing the tenant information.
Is there a setting i missed or something that is preventing sharepoint from including the full link when sending the email?
I made sure the full link was typed when the hyperlink was created and am using an HTTP to share point (in automate) and inserting the "CanvasContent1" into the email. I checked the html being sent and the link title is given as the full link but the href is given as /sites/xxx/xxx.aspx.
Thank you for everything
On a SharePoint page, links will be converted to relative links when the page is saved.
If you copy the page content as rendered into an email, then, yes, the tenant will not be included in the link, since the link is never intended to be used outside of the context of the page, where the link works fine.
So, you need to change your approach when emailing the page. Maybe email just a link to the page, then people can take it from there. Or, manipulate the html content in PowerAutomate and replace /sites/xxx with https://Yourtenant.sharepoint.com/sites.xxx

SharePoint Embed web part re-writing my URL

SharePoint Online: Until yesterday, I was able to use the standard Embed web part to display an iFrame to my SSRS Report server that included the control settings in the URL to hide toolbar, etc.
Like this:
<iframe src="https://reports.mydomain.com/ReportServer?/Reports/WallChart_GP&rs:Command=Render&rc:Toolbar=false&rs:ClearSession=true" height="400" width="300"></iframe>
Today, that is suddenly resulting in "Reporting Server Error: The operation you are attempting on item '/' is not allowed for this item type. (rsWrongItemType)". However if I put the URL directly into a browser I get the correct result... report with no toolbar.
When I switch the SharePoint page to edit mode and look at the Embed web part, I see that it's changing my & to & plus "amp;" for HTML formatting. If I paste that modified string into a separate browser I do still reach the report but the server ignores at least some of my commands in that I then see the report server toolbar despite setting it to false. So I don't know if it's always changed my URL like that, or if that is indeed the source of my problem. But I had not even re-published my pages in SharePoint.
If I put an embed string in the SharePoint web part that does not attempt these report server commands, I do get the report as desired. For example this displays my report in the SharePoint web part (but with the toolbar that I'm trying to avoid showing):
<iframe src="https://reports.mydomain.com/Reports/Pages/Report.aspx?ItemPath=%2fReports%2fWallChart_GP" height="400" width="300"></iframe>
The thing that has me bring this here is the fact that it was working up until yesterday. Nothing was changed on either end. I suppose Microsoft Support may be the correct avenue but I'm concerned that I will just be told that I can't do it without regard to the fact that it worked all along.
Any insight into why this is now different or what I can do to resolve the problem?

Excel links to JIRA issues forcing re-authentication

Situation
Attempting to launch a JIRA issue hyperlink from Excel 2013 drives the user to a login page for JIRA which is unexpected as the user has an active login session.
Example link format --> https://<subdomain>.atlassian.net/browse/<proj-#>
Even if the user logs in the first time, checks the box for "Keep me logged in" the user still must repeat this the next time a JIRA link from Excel is selected.
The URL appends the parameter &permission-violation=true
Attempts to Debug
Copy the link to clipboard and paste directly in browser URL bar. This method does not generate the permission violation. User can go directly to issue without logging in again.
Attempt the link in a different Office 2013 application. Using the same link from a MS Outlook 2013 email does not generate the permission violation.
Browse the JIRA administration page for solutions. Could not find any such option to configure.
Tested with both Firefox and Chrome set as the default browser. Issue persists for each.
Any suggestions to fix this? The behavior is very frustrating to our end users.
The Problem
According to StackOverflow user myroslav, certain versions of Excel are first attempting to fetch the webpage using a Microsoft DLL that does not know about your browser's cookies (i.e. your login session). Here's an excerpt of his answer:
If session cookie protects website Hlink naturally is being redirected
to login page and having reached HTML page and not able to
"understand" it opens it in external browser. Note that it opens not
original URL (expected behavior) but the result of redirect, even if
it was 302 redirect.
His full answer can be read here.
The Solution
At this time, Microsoft has recommended that companies with single sign-on sites like Atlassian's should address the issue on their end. Such a fix is low on Atlassian's priority list. In the meantime, we are left to either accept Microsoft's solution - modify the registry as myroslav instructs and accept a loss of Excel functionality - or modify our URL to something that doesn't require single sign-on user validation.
The Workaround
I'm using Excel 2016 and Chrome. Taliesin's workaround, elsewhere on this page, did not work for me, but might work for some. Here's a next-best-thing workaround that did work:
HYPERLINK("https://<subdomain>.atlassian.net/issues/?jql=id%20in%20("&<cell>&")", "link")
Replace <subdomain> with your Atlassian subdomain, and <cell> with the cell containing your JIRA issue key.
This URL variant opens a search query for issues matching the given key. It doesn't take you directly to the issue, but it at least offers a convenient link to get where you want to go, which is at least better than entering your credentials on the login page again.
Try restarting the browser and login to JIRA by selecting keep me signed in
It seems to resolve the issue: https://www.redmine.org/boards/1/topics/14287?r=40540
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\"YOUR OFFICE VERSION"\Common\Internet]
"ForceShellExecute"=dword:00000001
Workaround
Ok. So I have discovered a workaround. Note this will correct the issue in an indirect way by leveraging JIRA's own link correction behavior. Essentially, you can bypass the security issue by providing JIRA with an incorrectly structured URL. JIRA will then fix the URL and redirect you to the correct page.
Here is the structure https://<subdomain>.atlassian.net/browse/<proj-#> + /
Note the last forward slash. This does not belong in the URL construction but when used will establish the redirect and thereby bypass the security violation.
If you already have your hyperlinks in a JIRA file you can easily update those in batch by using this simple VBA code subroutine.
Sub AppendJiraLinks()
Dim c As Range
Dim i As Integer
For Each c In Selection.Cells
If c.Hyperlinks.Count >= 1 Then
For i = 1 To c.Hyperlinks.Count
c.Hyperlinks(i).Address = c.Hyperlinks(i).Address & "/"
Next i
End If
Next c
End Sub
Note this code could be enhanced but works fine for my purposes.

Resources