473,569 Members | 2,729 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need help with Office Interop!

I am trying to build .NET Windows form application to manipulate data is
specified Excel spreadsheets, but I am running short on information and my
searches of MSDN aren't finding the data I need.

I really don't know if it is better to ask here in the C# group or some
Office group. I am trying to write the code in C#, but this requires
knowledge of the Office Excel Object model.

So far I have:

* Figured out how to create an Excel Application from my Windows Form

* Used the MSOffice FileOpen dialog to open a selected workbook.

* Assigned both the workbook and worksheets to my application variables.

* Created a new worksheet, positiioned and named it.

The code below shows one way to set range variables, but I want more
interaction between the Excel application and my program. I want to be able
to select a range in the Excel application and to capture that range in the
windows form. I want to tell the application by pointing to it that this is
the data I want the application to process. If I cant find out how to do
that I should be able to get much farther.

// C#

rng = ws.get_Range("A 1",Type.Missing );

rng = ws.get_Range("A 1:B12",Type.Mis sing);

For all the talk of event driven programming I don't seem to be able to find
enough information on Excel events. there must be events related to cell or
range selection, cell activation, etc. So far all I have found are some
events at either the application level or the worksheet level, but not the
ones I would think are there.

Does anyone know how you can capture the cell addresses or range definitions
in .NET?

What I'd like to do is to move some of the worksheet data into an array or
arraylist object or two and to process it there. Then I'd move it back to
another worksheet.
Nov 17 '05 #1
0 955

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1026
by: Helene Day | last post by:
I am trying to access the Word Objects from a .NET project. I have some sample from http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_vsto2003_ta/html/WordObject.asp and I have MS Office 2003. However I don't know which file I need to reference for the MS Word 11.0 Object Library. Or what else do I need to...
0
2022
by: W Akthar | last post by:
Hi All, I have created a simple Windows Service which needs to be able to send appointments to Outlook. I have no problem makeing a reference to Microsoft Outlook 11.0 Object Library and compiling the code. the problem arises when I try to install the service using installutil. The error message I get is the following
5
49789
by: Michael Russell | last post by:
Hi all, Using C#, I've created a simple wrapper class for using Excel. I have Office Pro 2003 installed on my devel machine. The wrapper class works great, reading and writing to/from Excel. To do this, I created a reference to "Microsoft Excel 11.0 Object Library", and have a "using Excel;" directive. I decided to add a method for...
1
12617
by: Robert Bravery | last post by:
HI all, I'm new to C#. I want to open an excel document and work with it in C#. I currently have Excel2000, I think it is version9.0. But Clients might have office XP, XP2003 on Could someone be so jind as to show me some code or point me in the right direction. Thanks
2
7287
by: JC | last post by:
Anybody knows what problem has this code? I think, in the Garbage Collector? You know the Solution? The program in the test's case, whit 350 contacts, run OK before number 86. The error is a "Array index out of bounds". Microsoft.Office.Interop.Outlook._Application olApp = new Microsoft.Office.Interop.Outlook.ApplicationClass();...
0
2729
by: liam_jones | last post by:
I'm very new to Python, well IronPython to precise, and have been having problems when using Excel. The problem I'm having is the closing of my Excel object. I'm able to successfully quit the Excel Application that I create, but when I open a Workbook in the Application I can't successfully Quit Excel (by this I mean I can quit it, but the...
1
3212
by: =?Utf-8?B?cm9i?= | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I...
1
2850
by: allbelonging | last post by:
C#.Net Outlook 2003 automation (programmatically) with Office.Interop.Outlook Problem: I have my outlook 2003 configured with multiple mailbox on my local machine. I want to specify the mailbox and server (Exchange server mail box) to connect and then save the mailitems(from Inbox or any other folder) based on a filter to a*.msg file. I...
0
2329
by: Nicholas Dreyer | last post by:
Operating System: Microsoft Windows Version 5.1 (Build 2600.xpsp_sp2_gdr.050301-1519 : Service Pack 2) Visual Basic: MIcrosoft Visual Basic 6.3 Version 9972 VBA: Retail 6.4.9972 Forms3: 11.0.6550 (comes with Excel 2003) The copy paste code below fails to copy the PrefixCharacter from cell "a1" to cell "a2" when compiled into a dll and...
2
4917
by: Nicholas Dreyer | last post by:
The following error Run-time exception thrown : System.Runtime.InteropServices.COMException - Error loading type library/DLL. happens while running the code listed at the bottom of this message in the environment shown here: Operating System: Microsoft Windows Version 5.1 (Build
0
7694
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7609
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7921
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8118
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7666
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
1
5504
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3636
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1208
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.