Visual Studio 2017 no reference to Microsoft.Office.Interop.Excel - excel

Upgrade to VS 2017 and now I there is no references available to Microsoft.Office.Interop.Excel
Where did the reference go?

You should be able to "Add reference", select "Assemblies", press the "Browse" button, traverse to a path along this line (most likely close to your machine but slightly different):
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Visual Studio Tools for Office\PIA\Office15
Then you should see to select:
(Source Stack Overflow user: #karen-payne)

Go to Visual Studio Installer under Individual Components and click 'Office Developer Tools for Visual Studio. This solved it for me after lots of headaches.

Related

Visual studio in Administrator mode

my visual studio is not opening in administrator mode on opening a project by clicking a solution. By default i set it as run as administrator. but, still it is not opening if i directly open the project by clicking the project solution file.
If you open Visual Studio, right-click on the Taskbar icon of it, and select Properties.
In the tab Shortcut, press the Advanced button and tick 'Run as administrator'. Click OK.
In the tab Compatibility, tick the 'Run this program as an administrator' option. Click OK.
Apply and close the properties dialog.
I changed those settings on my computer and it always starts in administrator mode.
This is a copy of my answer to a similar post on SuperUser:
Option 1 - Set VSLauncher.exe and DevEnv.exe to always run as admin
To have Visual Studio always run as admin when opening any .sln file:
Navigate to C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe.
Right-click on VSLauncher.exe and choose Troubleshoot compatibility.
Choose Troubleshoot program.
Check off The program requires additional permissions and hit Next.
Click the Test the program... button to launch VS.
Click Next, then hit Yes, save these settings for this program, and then the close buton.
To have Visual Studio always run as an admin when just opening visual studio directly, do the same thing to the DevEnv.exe file(s). These file are located at:
Visual Studio 2010
C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe
Visual Studio 2012
C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe
Visual Studio 2013
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe
Visual Studio 2015
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe
Option 2 - Use VSCommands extension for Visual Studio
Install the free VSCommands extension for Visual Studio (it's in the Visual Studio Extensions Gallery) and then configure it to always have Visual Studio start with admin privileges by going to Tools -> VSCommands -> Options -> IDE Enhancements -> General and check off Always start Visual Studio with elevated permissions and click the Save button.
Note: VSCommands is not currently available for VS 2015, but their site says they are working on updating it to support VS 2015.
My Opinion
I prefer Option 2 because:
it also allows you to easily turn off this functionality.
VSCommands comes with lots of other great features so I always have it installed anyways.
it's just easier to do than option 1.

Visual Studio 2012 Ultimate: error MSB8020:

i have Visual Studio 2012 Ultimate version 11.0.61030.00 update 4.
i try to compile with Daffodil toolset platform v60
enter link description here
but how fix this error?
Error 4 error MSB8020: The builds tools for v60 (Platform Toolset = 'v60') cannot be found. To build using the v60 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install v60 to build using the v60 build tools. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets.
location files from Daffodil is:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\Win32\PlatformToolsets\v60
any help pls
ty.
Right click the project from the solution explorer, click properties, when it opens expand configuration properties and open the general tab.
Within there, there is a field called 'Platform Toolset' drop down the row next to it and choose the option that should have v60 in the title!
In order to use Daffodil in versions later than VS2010, you need the platform toolset of VS2010 installed AND the toolset you want to use, which is VS6. Have you installed both?
To use these platform toolsets, you must have the targeted version of Visual Studio installed. Currently supported pl
Visual Studio 2012/2013/2015
Daffodil works fine in VS 2012 and later versions as long as VS 2010 is also installed.
Source: https://daffodil.codeplex.com/

How to choose which version of Visual Studio gets pulled up by default?

I have VS 2012 and 2013 installed on my system.
I have a 2012 project that I want to get pulled up in VS 2013 when I double-click it from the Windows Explorer.
Is this possible?
If you only want specific slns to open in 2013, you can open the sln file in a text editor, and change the line
# Visual Studio 2012
to
# Visual Studio 2013
Note that it will ask you to upgrade the projects to 2013 when you open it for the first time. If you want all of 2013's compiler features you will have to upgrade, but if you chose not to it will still load in the 2013 IDE and you get some of the IDE related features.
Right click any solution file and select Open with... option. Use Visual Studio Version Selector as the default program to use for Visual Studio solution files.

Visual Studio 2012 error: Package 'Visual C++ package' failed to load

When I'm trying to open any solutions that worked fine before in Visual Studio 2012, the error "Package 'Visual C++ package' failed to load" keeps showing up. And the solution can't be opened.
I'm not sure what's wrong with my Visual Studio 2012 installation.
click the TOOLS--->VISUAL STUDIO COMMAND PROMPT to open the command window
input the command "devenv /Setup"
open the visual studio 2012 again, it will works.
Source: http://happyivyli.blogspot.com/2013/07/visual-c-package-failed-to-load.html
Running command prompt from inside Visual Studio.
For easier access, you can add the Visual Studio Developer Command Prompt or any other command prompt to the Tools menu on Visual Studio, by adding it to the external tools list. This is how you can accomplish that:
Open Visual Studio.
Select the Tools menu and choose External Tools...
On the External Tools dialog box, choose the Add button. A new entry appears.
Enter a Title for your new menu item such as Command Prompt.
In the Command field, specify the file you want to launch such as %comspec% or C:\Windows\System32\cmd.exe.
In the Arguments field, specify where to find the specific command prompt you want to use such as /k "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\VsDevCmd.bat" (this will launch the Developer Command Prompt installed with Visual Studio 2015). This value needs to be changed according to your Visual Studio version and installation location.
Choose a value for the Initial directory field such as Project Directory.
Choose the OK button.
After that, the new menu item is added and you can access the command prompt from the Tools menu.
Then:
Right-click the Visual Studio icon
Choose Run As Administrator
Click the menu TOOLS → *Command Prompt** to open the command window
Input the command "devenv /Setup"
Open Visual Studio again, and it will work.
None of the solutions I found around, including those listed here, seemed to help. What did work was going in the software install/uninstall management, right clicking on Visual Studio and choosing "change" (that's where you would normally uninstall something from).
That should pop up the Visual Studio package manager, and from there you can choose repair.
In my case, looking at the systems backlog and restore points, it seems it was one of the Visual C++ redistributables, possibly installed by some game, that compromised the environment.
This is on Windows 8.
Possibly same fix as this https://stackoverflow.com/a/21266545/990618
Check your User environment variables for VCHOME, VCINSTALLDIR and vsinstalldir.
Change
X:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\
to
X:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\
Or
X:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\
depending VS 2012 or 2013.

Is Tools > Create GUID removed in Visual Studio 2012?

In Visual Studio 2010, there was a Create GUID entry in the Tools menu. I used it all the time for SharePoint Development.
Has Tools > Create GUID been removed in Visual Studio 2012? I don't see it and resorted to Powershell [System.Guid]::NewGuid().ToString()
No it's there... at least it's available in Visual Studio 2012 Ultimate.
If missing try adding it via Tools -> External Tools and add:
%Installation Path%\Microsoft Visual Studio 11.0\Common7\Tools\guidgen.exe
EDIT: It's probably installed with Visual C++.
If you have Resharper installed you can just type nguid and hit Tab inside Visual Studio. You can even choose format you want.

Resources