I have an excel sheet with more than 10 tables, and I would need to import those tables into a c# windows application.
I started to do the same by trying to import these tables into a datatable in c#.
I am using visual studio community 2013, and when I try to reference the Microsoft office in my project I only get "Microsoft.Office.Core". I am not sure how do I use this in my application to import my excel sheet.
Do I need to have licenced Microsoft Office to import a excel into my application?
Add a reference to the Excel Interop DLL in the PIA folder:
%ProgramFiles%\Microsoft Visual Studio 12.0\Visual Studio Tools for Office\PIA\Office15
Related
I have 3 versions of MS Excel installed on my PC. I am developing some VSTO Tool. VS debugger fires currently MS Excel 2013. What should I do to force VS to debug tool in other version of MS Excel?
Replace the interop reference with the target version and use the Start external program option in the Properties window as shown below:
Specify the path to the target Office Excel version.
I have an Excel Add in , which is built in Visual Studio using C#.
This add-in was designed for Microsoft Excel 2010, but I want to know if it is possible to run the same add-in in excel 2013.
I am getting the following error:
You cannot debug or run this project because the following version on microsoft office is not installed
Is there any way to run the same code for Excel 2013?
Yes it is, but it searches for Office 2010 by default. If you have Office 2013 installed, it can't find it.
You should provide the startup executable to Visual Studio. You have to set the Start external program in the project properties to the Excel executable. At my desktop it is C:\Program Files\Microsoft Office\Office15\EXCEL.EXE.
I'm trying to create a custom Excel add-in.I currently have Visual Studio Ultimate 2013 and Microsoft Excel 2010.The problem that I currently have is that when I create a new Excel Add-in project and I try to build, it says that I haven't got a proper version of Office installed and it provides a link for reference. Whenever I visit the link it actually says that Excel 2010 is supported. Whenever I start excel it actually loads the add-in in the list of installed add-ins,but I cannot debug or run it in Visual Studio! Has anyone had any problems with this?
I need to import a document library created in Sharepoint 2010 into Visual Studio 2010 to be able to deploy it as a part of the final solution. How can it be done?
You can export a document library easily by going to the library settings and choose "Save document library as template". This template then is easily imported to Visual Studio 2010.
What you can also do though is to export your whole Site as a site definition which you then can import to Visual Studio and probably extract your document library. Here is some sample code and a video:
Importing SharePoint 2010 Site Definitions in Visual Studio 2010
I want to use C# class methods in Excel. Can anybody guid me how to do it ?
The C# component will be excel add-in. How to create setup for this addin, so that I just need to give setup to user which will install add-in at client's machine. User should not need to do any other steps like registering the C# dll.
(Disclaimer: I develop the Excel-Dna library.)
You should have a look at Excel-Dna - http://excel-dna.net. The library allows managed assemblies written in C#, VB.NET or F# to expose high-performance user-defined functions (UDFs) and macros to Excel through the native .xll interface. The project is open-source and freely allows commercial use.
With Excel-Dna you can create a single .xll add-in file that the user can open as an add-in without any further installation or registration. Excel-Dna add-ins can expose RTD servers and customized Ribbons for Excel 2007 and Excel 2010 without additional registration, so you need no extra setup program.
You will need to create a new Visual Studio project of type Excel 2007 Add-In (or Excel 2003 Add-In). The option for this can be found (in Visual Studio 2008) at:
New Project dialog -> Project types -> Visual C# -> Office
This Add-In will need to be installed on the target machine(s).
The Add-In will be able to hook into the Excel object model and therefore access any loaded spreadsheets etc.
The Add-In will also be able to add buttons to the Excel toolbar/ribbon.
Try looking at VSTO, there's a section explicitly for Excel
You can create Excel projects within Visual Studio (previously known as Excel VSTO projects) or you can use a third party library such as ExcelDna.