Solution: “The embed code is invalid because the source of the embed content is not allowed” error when embedding Microsoft Stream video in SharePoint

A user recently ran into the following error when attempting to embed a Microsoft Stream video on a SharePoint 2016 site:

“The embed code is invalid because the source of the embed content is not allowed.”

To resolve this, you must be a site collection administrator.

Go to site settings and select “HTML Field Security” under “Site Collection Administration.”

By default, SharePoint allows embeds from YouTube, Bing, Vimeo, and Microsoft but we need to add web.microsoftstream.com to the list.

Now try to embed your video again, and it will work.

SharePoint search results showing wrong title

I recently ran into the issue of a document appearing in search results that didn’t use the name field OR the title field. I was perplexed by this until checking the search schema for the “Title” field. In an attempt to be helpful, there’s a property called MetadataExtractorTitle that was given higher preference than the actual title field. To fix this, I simply had to bump it down the list a bit.

Scenario

The document in question is a SharePoint Governance meeting agenda named SP Governance – 2017-11-17.

It appeared correctly in its library, which is to be expected:

And a look at its properties revealed there was no Title value, meaning it would default to the document name.

However, when searching for “SP” I found the document listed as “Agenda.” This was used because the MetadataExtractorProperty found “Agenda” within the document as a potential title (as the first line of the document).

Solution

Note: You must be at least a site collection administrator.

Go to Site Settings at the top level of the site collection for the document library.

Choose “Search Schema” under Site Collection Administration (not just “Schema” under search – that’s only site level)

Search for title and edit the property

Move “MetadataExtractorTitle” down until it’s beneath ows_Title. Click OK when finished.

Click to enlarge

Checking your work

After fixing the schema, go back to the document library and re-index it to check. (Library Settings –> Advanced Settings –> Reindex Document Library)

This will have the library re-crawled during the next incremental crawl (interval depends on administrator settings). Alternatively, you could trigger it immediately or run a full crawl.

Once the crawl has run, try your search again. Your items should now have a correct title when appearing in search results.

Run Google Chrome as a different user to test

In an on-prem environment, it’s convenient to be able to run Chrome as a test user with general permissions instead of my admin permissions. This possibility makes it so I don’t need to remote to another machine or log out and in with another account just for a simple check.

Using Internet Explorer? Here’s how to do the same with that.

If you have a shortcut to Chrome on your desktop (not your task bar), skip ahead to step two.

1. Search “Chrome” from the start menu, right click and select “Open File Location”

2. Hold “Shift” on your keyboard and right-click the Internet Explorer icon. Select “run as different user”

3. Enter the credentials for the second user (your screen/prompt may look different) and click OK/Login. In some cases, you may be prompted to enter these more than once.

Chrome will now run as if the other user is logged in.

You can also use the “Check permissions” feature in SharePoint to see which groups a user belongs to for a site or resource, and which abilities/privileges they have.

Run Internet Explorer (IE) as a different user to test

It’s often helpful in our on-prem environment to be able to run IE as a test user with general permissions instead of my admin permissions. This possibility makes it so I don’t need to remote to another machine or log out and in with another account just for a simple check.

Using Google Chrome? Here’s how to do the same with that.

If you have a shortcut to IE on your desktop (not your task bar), skip ahead to step two.

  1. Search “IE” from the start menu, right click and select “Open File Location”

2. Hold “Shift” on your keyboard and right-click the Internet Explorer icon. Select “run as different user”

3. Enter the credentials for the second user (your screen/prompt may look different) and click OK/Login. In some cases, you may be prompted to enter these more than once.

IE will now run as if the other user is logged in.

You can also use the “Check permissions” feature in SharePoint to see which groups a user belongs to for a site or resource, and which abilities/privileges they have.

Check permissions for an individual or group in SharePoint

If you want to see which groups a user belongs to, or how an individual is granted (or restricted) access to a particular site or resource, use the “Check permissions” button in Site Settings –> Site Permissions (or any advanced permissions page).

SharePoint 2016 example of checking permissions
SharePoint Online example of checking permissions (see specific allowances)

“The selected file doesn’t contain template elements” error in Microsoft Flow

I recently tried to use the “Populate a Microsoft Word template” step in Microsoft Flow (currently in preview) to insert text into content controls, but ran into the error above.

The selected file doesn’t contain template elements.

The issue was that my content controls in the template were of rich text format and date. This preview step currently only supports plain text, combo box, and dropdown content controls.

Plain text, combo box, and drop down are the only supported content controls as of the publishing of this post.

So for all of your text fields, make sure you use the correct (plain text) control:

Once I replaced my rich text content controls with plain text, the content controls showed up in Flow as options for populating:

To keep this organized, I recommend giving each content control a title (in its properties) so you can easily identify each field when in Flow (select content control, then “Properties” from developer tab).

Remember, you’ll only see supported content type fields in Flow. Even if you have a date content control, you won’t be able to populate it using Flow.

Solution: “Feature requires a browser that supports ActiveX controls” when importing spreadsheet to SharePoint

If you’re trying to import a spreadsheet as a new list in SharePoint, you’ll need to use a browser that supports ActiveX controls or you’ll get the error:

“This feature requires a browser that supports ActiveX controls.”

Chances are you’re running a browser other than IE, or you’re running IE version 11. ActiveX controls are not supported in IE11, or most browsers. We can work around this error message by having IE pretend it’s version 10 momentarily.

  1. Open SharePoint in Internet Explorer (IE)
    • Quick access: Hit Windows key, type IE, hit enter
  2. Press F12 to open Developer Tools and select the Emulation Tab
  3. Change Document mode from 11 to 10 (supports ActiveX). Page will reload so you can try again in version 10.

Now try to import the spreadsheet again and it will work fine, opening your spreadsheet and prompting you to select the table or relevant data for import.

Preserve Excel hyperlinks when saving as PDF

If you have hyperlinks in your excel files and need to save your file as a PDF, you’ve probably run into the error in which your hyperlinks in the PDF output are inactive.

To be able to maintain hyperlinks you will need Adobe Acrobat. If you don’t have it, please skip down to the bottom of this post to the “Don’t have Adobe Acrobat?” section.

If you do have Adobe, it’s quite simple unless you’re using the HYPERLINK() formula (see below). Just use the Acrobat add-in to save as Adobe PDF.

File –> Save as Adobe PDF –> Convert to PDF. You can also use the Acrobat tab in the ribbon and click “Create PDF”.

Using HYPERLINK() formula

If you’re using the hyperlink formula, as seen below, we’ll need to do some manipulation to our sheet first. Printing to PDF will require that your hyperlinks are properly written before conversion (http… or https…).

To get just the hyperlinks from our formula, we can copy values from Excel and paste into Word, then copy from Word and paste back into Excel (keeping source formatting).

Paste into blank Word document, then copy all values (not the whole table, just the column)
Back in Excel, select the original column values, and paste the new values copied from Word in their place

Now when you save as Adobe PDF, your links will remain active:

Don’t have Adobe Acrobat?

Save the Excel Sheet as a web page and links will work. This isn’t ideal but in a pinch will save you some stress.

Power BI refresh error “could not load file or assembly…provided impersonation level is invalid”

Short version

Run Power BI Desktop as administrator before opening the report.

Explanation/Scenario

Recently, when opening a report from Power BI Report Server that used a SQL database as a data source I received the following error.

An error happened while reading data from the provider: ‘Could not load file or assembly ‘System.EnterpriseServices, Version=4.0.0.0, Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a’ or one of its dependencies. Either a required impersonation level was not provided, or the provided impersonation level is invalid. (Exception from HRESULT: 0X80070542)’

So I clicked “Edit Queries” to see what was going on and received almost the same error but referencing a specific table and getting me thinking about SQL specifically.

Error seen after clicking “Edit Queries”

So I checked that table in the query editor and received yet again the same error.

Error seen after clicking the specific table referenced in the previous error message

Simple solution. It’s likely that your credentials and queries are just fine.

The solution for my particular issue here, and the meaning behind the “impersonation level” part of the error, is just that you need to run Power BI Desktop as administrator before accessing the report. After opening the report in Power BI Desktop being ran as an administrator, everything worked as expected.

“Unable to connect” error when accessing SQL database in Power BI Desktop

When attempting to access a SQL server/database in Power BI, you might get the following error message:

Unable to connect

We encountered an error while trying to connect.

Details: “An error happened while reading data from the provider: ‘Could not load file or assembly ‘System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=…..

Error message received when trying to get a SQL database as a data source in Power BI

Solution

You just need to run Power BI as administrator before attempting to access the SQL database as a data source.

  1. Save your work and close Power BI Desktop
  2. Right click Power BI Desktop and select “Run as administrator”

3. Attempt to access your database again – you shouldn’t have an issue.