Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Accessing value in a range using Automation in a C# DLL

Greetings I followed the steps in this blog here to create my C# DLL that
contains my excel 2003 UDFs:

http://blogs.msdn.com/eric_carter/ar...01/273127.aspx

The problem I am having is when I pass in a range of cells from excel into
my function which resides inside my Automation DLL I just cannot figure out
how to access the cell values individually. Here is an example of my
functions:

public double SecondValueIs(object Range)
{
int SecondCell= 0;
Excel.Range r = Range as Excel.Range;

//What code do I put here to get the second cell if its a one
row range?
//lets say that I passed in A1:A5?
//
//object value = r.Cells[1,2].value DOES NOT work no VALUE
method ...
//string value = r.Cells[1,2] DOES NOT work .. cant convert COM
object to string ...


return SecondCell;
}

If I look inside r.FormulaLocal for instance I can see a list of my cell
values but I cant convert or otherwise manipulate them. There HAS to be a
way to do so. What am I doing wrong?

Thank you in advance for your time.

~Rob.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Accessing a variable(a range) and modifying it James Cornthwaite Excel Programming 1 May 30th 06 11:01 PM
Accessing specific items in a range droopy928gt Excel Programming 3 January 8th 06 06:48 PM
Excel Automation Add-In, Accessing the application object smedcalf Excel Programming 1 March 10th 05 09:10 PM
Range.Formula and Range question using Excel Automation [email protected] Excel Programming 0 September 19th 03 04:53 AM
Accessing/Clearing range in hidden workbook DarrenW Excel Programming 2 July 17th 03 04:00 AM


All times are GMT +1. The time now is 08:04 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"