Posted on 2010-01-11
Medium Priority
Last Modified: 2013-12-17
what are the files need to be
Navigate to COM tab, and find and select Microsoft Excel 12 Object Library (if you use Office 2007), click OK. (If you use Office 2003, the name should be Microsoft Excel 11 Object Library)

4.       Add the following codes to import Excel NameSpace.

1.     Created a C# Empty project named CSVToExcel. Added a class file named CSVToExcel.cs to the project.

2.       In the Sulotion Explorer Window, right clicked  the CSVToExcel project, clicked Add Reference. Then Add Reference Dialog pops up.

3.   Navigate to COM tab, and find and select Microsoft Excel 12 Object Library (if you use Office 2007), click OK. (If you use Office 2003, the name should be Microsoft Excel 11 Object Library)

Code Block
using Excel = Microsoft.Office.Interop.Excel;
i did above and i did rebuild all solution.  but it did not create interop.microsoft.office.core.dll.
please let me know am using .net framework 1.1 with c# 1.1
vs 2003. office 2007 , office pias 2007 on xp platform.

Question by:ram27
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
LVL 36

Expert Comment

by:Miguel Oz
ID: 26290649
please install office 2003 PIA (you do not need to build your own COM interops)
You only need to add the following references:

For sample on how to use them:
automate Excel vb.net with no VSTO only PIAs (it is vb, but any optional you need Type.Missing)

Author Comment

ID: 26295443
Here is my question i hope this will help to understand:
 i use .net framework 1.1 c# on windows XP platform with Office 2003( Microsoft Office 10.0 Object Library) /2007(microsoft Office 12.0 Object Library).  i did below mentioned steps:
step1. Start Microsoft Visual Studio .NET.
On the File menu, click New, and then click Project. Select Windows Application from the Visual C# Project types.
step2 . Add a reference to Microsoft Office  Object Library. To do this, follow these steps:
On the Project menu, click Add Reference.
On the COM tab, locate Microsoft Office  Object Library, and then click Select.  and and clik on "OK" button.
In step2, when i choose " Microsoft Office 10.0 Object Library", and when i do rebuild all , it creates "Interop.Microsoft.Office.Core.dll" in "c:\myapplciation\bin\deug" folder along with "myapplication.dll".
But when i choose "  Microsoft Office 11.0 Object Library", and and when i do rebuild all , it does not create "Interop.Microsoft.Office.Core.dll" in "c:\myapplciation\bin\deug" folder. it just creates "myapplication.dll"
Please let me know, what is the difference?. Also when i choose "Microsoft Office 10.0 Object Library" , i will be distributing ""Interop.Microsoft.Office.Core.dll" along with "myapplication.dll" to users machines . Incase of "Microsoft Office 11.0 Object Library", if i distribute just "myapplciation.dll" will it work.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 36

Expert Comment

by:Miguel Oz
ID: 26298210
Your question is now a abit different because you are mentioning version 10.0 (office XP)
Quoting from my previous post link:
"Note Microsoft Office 2007 and Microsoft Office 2003 include Primary Interop Assemblies (PIAs). Microsoft Office XP does not include PIAs, but they can be downloaded.

For additional information about Office XP PIAs, click the article number below to view the article in the Microsoft Knowledge Base:
328912  (http://support.microsoft.com/kb/328912/EN-US/ ) INFO: Microsoft Office XP PIAs Are Available for Download
The difference is that evey Office version have slightly different COM interfaces and implementation. Thus the reason that you should compile your program with each library depending which Office version you are targeting.

Deployment: For office 2003 and 2007:
- All required libraries are installed with the PIA in the GAC.
- You only need your application and any other dll present in your debug/release.

I have no previous experience with Office XP, but my educated guess is that the same principles apply as per 2003. Office XP has PIA as well.

Author Comment

ID: 26298474

 i not using oofice Xp,
 here is are the details:
.net framework 1.1 c# on windows XP platform with 2003(microsoft Office 10.0 Object Library) with visual studio  2003.
now it will be migrated to Office 2007 i..e,
.net framework 1.1 c# on windows XP platform with 2007(microsoft Office 12.0 Object Library) with visual studio 2003.

LVL 36

Expert Comment

by:Miguel Oz
ID: 26299614
Office 2003 is version 11.0, you may have the wrong object library (version 10.0)

Accepted Solution

ram27 earned 0 total points
ID: 26316347
For Ofice 2003,  Microsoft Office 11.0 Object Library PIAS 11.0
For Office 2007, Microsoft Ofice 12.0 Object Library ,PIAS 12.0
When i reference Microsoft Office 11.0 Object Library , i need to set  Copy Local of Microsoft.Office.Core to true, inorder to create dll localyi ..e my out put folder.
but Microsoft Office 10.0 ( older version of Office ), by default it has setting Copy Local of Microsoft.Office.Core to true. So need not change any thing, when i do rebuild all it creats dll in "output" folder.
Also , with  Microsoft Office 11.0 Object Library and later version of Microsoft Office Object Library it creates Office.dll instead of Interop.Microsoft.Office.Core.dll.


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
New style of hardware planning for Microsoft Exchange server.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question