Questions tagged [office-interop]

Office Interop is the layer using the COM Interop that allows .NET or C# to communicate with standard COM objects and libraries.

Office Interop is the layer using the COM Interop that allows .NET or C# to communicate with standard COM objects and libraries.

3602 questions
113
votes
15 answers

What reference do I need to use Microsoft.Office.Interop.Excel in .NET?

I am interested in using C# to manipulate/Automate Excel files. After browsing the web I have found VSTO but it seems you can not use that in Visual Studio Express Edition so I can not use that. Just few minutes ago I noticed a question in this site…
user850010
  • 6,311
  • 12
  • 39
  • 60
105
votes
3 answers

The quest for the Excel custom function tooltip

This question has been asked before, but each time the accepted answer is simply a resignation to provide function descriptions using Application.MacroOptions (VBA6) (VBA7), but this information does not actually appear as a tooltip, so it does not…
Alain
  • 26,663
  • 20
  • 114
  • 184
96
votes
8 answers

Reading Datetime value From Excel sheet

when am trying to read datetime type value from excel sheet it is returning a double value.for example if want to read value '2007-02-19 14:11:45.730' like this, i am getting a double type value .further i am converting this double value using…
Pranav
  • 8,563
  • 4
  • 26
  • 42
74
votes
7 answers

Create Excel files from C# without office

I am writing a program that generates excel reports, currently using the Microsoft.Interop.Excel reference. My dev computer has Excel on it, but the end user may or may not have Office installed. Will this tool fail if Office isn't installed on…
tbischel
  • 6,337
  • 11
  • 51
  • 73
54
votes
4 answers

How to eliminate warning about ambiguity?

I have this warning: Warning 3 Ambiguity between method 'Microsoft.Office.Interop.Word._Application.Quit(ref object, ref object, ref object)' and non-method 'Microsoft.Office.Interop.Word.ApplicationEvents4_Event.Quit'. Using method group. on…
52
votes
6 answers

Accessing Office Word object model through asp.net results in "failed due to the following error: 80070005 Access is denied."

I have developed a website that allows users to upload office documents then uses the office object model to convert the document to an HTML file that it then displays in an iFrame. I have, of course, included references to Office.interop.word,…
Camenwolf
  • 798
  • 1
  • 9
  • 21
52
votes
5 answers

Can I still use Microsoft.Office.Interop assemblies with office 2013?

I had to import an older project (in .Net 2) into Visual Studio 2013, it makes use of the Microsoft Primary Interop Assemblies. Visual Studio said that I need to add references to the project. Now I went and did some reading and apparently Microsoft…
Zapnologica
  • 22,170
  • 44
  • 158
  • 253
50
votes
12 answers

How to read an excel file in C# without using Microsoft.Office.Interop.Excel libraries

I have a .Net-Windows application in C#. I need to open an excel and process it. How can I do this without using Microsoft.Office.Interop.Excel libraries?
ASD
  • 1,441
  • 3
  • 28
  • 41
49
votes
5 answers

How to Freeze Top Row and Apply Filter in Excel Automation with C#

I have automation to create an Excel document from C#. I am trying to freeze the top row of my worksheet and apply filter. This is the same as in Excel 2010 if you select View > Freeze Panes > Freeze top row, and then after selecting top row Data >…
KBP
  • 1,500
  • 2
  • 14
  • 14
48
votes
13 answers

How to make correct date format when writing data to Excel

Iam exporting a DataTable to an Excel-file using office interop. The problem is, that Excel does not recognize dates as such, but instead it displays numbers. In another case I pass a string which it then recognizes as a date. In both cases the data…
codymanix
  • 28,510
  • 21
  • 92
  • 151
44
votes
3 answers

Cannot debug or run Word AddIn because the required version of Microsoft Office is not installed

I need to work on an existing Word 2007 addIn project that's a part of a MSVS 2008 solution. However, when I try to debug the addIn, I get the following error message: "You cannot debug or run this project, because the required version of the…
sdds
  • 2,021
  • 2
  • 25
  • 33
43
votes
8 answers

Disposing of Microsoft.Office.Interop.Word.Application

(Somewhat of a follow on from the post (which remains unanswered): https://stackoverflow.com/q/6197829/314661) Using the following code Application app = new Application(); _Document doc = app.Documents.Open("myDocPath.docx", false, false,…
Maxim Gershkovich
  • 45,951
  • 44
  • 147
  • 243
39
votes
5 answers

Why am I receiving exception from Office's Outlook library?

I have an application that calls Email hello = new Email(appropriate constructor); hello.Email_Send(); I'm receiving the exception: Retrieving the COM class factory for component with CLSID {0006F03A-0000-0000-C000-000000000046} failed due to the…
Zee
  • 1,780
  • 3
  • 16
  • 27
36
votes
3 answers

How to open Outlook new mail window c#

I'm looking for a way to open a New mail in Outlook window. I need programically fill: from, to, subject, body information, but leave this new mail window open so user can verify content / add something then send as normal Outlook msg. Found…
Maciej
  • 10,423
  • 17
  • 64
  • 97
36
votes
6 answers

Can't get Microsoft.Office.Interop reference to work

I have a C# winforms app and I am simply trying to open an Excel sheet. When I try to add a reference to Microsoft.Office.Interop, the "Office" part is red and says "Can't resolve symbol 'Office'". When I attempt to build, the error is: The type or…
Ben Strombeck
  • 1,509
  • 1
  • 17
  • 22
1
2 3
99 100