Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default Range address from Excel in C#

Hope this is the right forum, if not please indicate which is.

Have implemented a SelectionChange event for Excel in C# - code below:

private void SelectionChange(Excel.Range Target)
{
_currRng = Target;
_currWS = (Excel.Worksheet)_currRng.Worksheet;
_currWB = (Excel.Workbook)_currWS.Parent;
string address =
_currRng.get_Address(Missing.Value,Missing.Value,
Excel.XlReferenceStyle.xlA1 ,Missing.Value,Missing.Value);
lblWB.Text = _currWB.Name;
lblWS.Text = _currWS.Name;
lblAddress.Text = address;
}

Invariably address comes out with an empty string ("") in the routine above.
However, if I get the address with the same statement after the
'SelectionChange' procedure has completed I get the correct address. What am
I missing?

ojv
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
=HYPERLINK("#"&CELL("address", ADDRESS(MATCH(VALUE(B3),Range ... ? sarah Excel Worksheet Functions 0 February 17th 09 02:06 PM
How to create a range address with ADDRESS function? Steve McLeod Excel Worksheet Functions 1 December 18th 08 02:02 PM
How do I avoid excel change absolute address to relative address Miguel Excel Discussion (Misc queries) 3 May 10th 07 11:18 PM
Deleting Range name's listed in the range address box. Satnam Patel Excel Discussion (Misc queries) 4 May 5th 05 01:42 PM
LINKING Address cells from an EXCEL spreadsheet to fill MapQuest Address Info Duane S. Meyer Excel Programming 0 August 30th 03 12:16 AM


All times are GMT +1. The time now is 11:49 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"