0

I want to link Excel files to a solution in SSMS to have the handy for reference. Adding them works just fine. They show up under Miscellaneous. SSMS recognizes that they are Excel files by putting the logo next to them. However, when I select one, I get an error.

Microsoft SQL Server Management Studio

Unable to open file Summary.xlsx. File may not have an associated editor.

Oddly, once selected, I can double-click the file and it opens in Excel as expected.

I tried setting the extension in Tools > Options... > Text Editor > File Extension but, obviously, that is for text editors. None of the available editors in the list is an Excel editor. So, I set it to the Automatic Editor Selector (XML) option. The error still occurs.

I have also reviewed Management Studio won't recognize other file extensions and do not think this is the same question. Please correct me if I'm wrong.

The idea is just to have the files handy. I'm ok with double-clicking them to open them in Excel, but is there some way to get rid of that error that happens when I select the file? Is what I'm doing an uncommon practice?

Version Info

Component Name Versions
SQL Server Management Studio 19.0.20209.0+f9a9d8f6
SQL Server Management Objects (SMO) 16.200.48036.0+7d3b143d945e1aa638acdb02c0364e263d5ec973
Microsoft T-SQL Parser 16.0.22524.0+62eedb15cd3cde34e51c8fbbdf9b06e575ec912e
Microsoft Analysis Services Client Tools 16.0.19993.0
Microsoft Data Access Components (MDAC) 10.0.19041.3208
Microsoft MSXML 3.0 6.0
Microsoft .NET Framework 4.0.30319.42000
Operating System 10.0.19045
StoneGiant
  • 121
  • 4

2 Answers2

2

What's happening is that SSMS is trying to preview the files. I noticed that if I selected a normal SQL script it simply selected it. When selecting a non-SQL file, it would try to open the file in a preview tab.

I went into Tools > Options > Environment > Tabs and Windows and found the Preview Tab selection. I unselected Preview Selected Files in Solution Explorer. Now, when simply selecting the file, it does not try to preview it in a code window. The error is gone.

Problem solved.

View of the Options Window Showing the Preview Options

StoneGiant
  • 121
  • 4
1

Is what I'm doing an uncommon practice?

IMO, it's pretty rare. I've never heard of anyone using Solutions in SSMS, and I'm sure it's a feature Microsoft hasn't spent much TLC on in a long time. Let alone providing an editor for Excel files. I doubt that's ever been available.

So, I set it to the Automatic Editor Selector (XML) option. The error still occurs.

Makes sense, XML is completely different from Excel files.

I want to link Excel files to a solution in SSMS to have the handy for reference.

What benefit do you stand to gain by doing this, knowing that they can't be opened / edited in SSMS, as opposed to just keeping the folder they're physically located in open?

J.D.
  • 40,776
  • 12
  • 62
  • 141