Finding excel row number based on X axis value

R

Ran

Hi,

I am creating an application in VB that would allow user to drag and
drop a VB image control on to a owc10 spreadsheet. On the dragdrop
event of owc10, I will know the value of x axis and y axis and I need
to translate this to a excel row and column number respectively. Has
anyone got any suggestion as to how this can be done? Appreciate your
help.
 
A

Alvin Bruney [MVP - ASP.NET]

before you go off coding the world, what do you intend to do with that
image? Embedding images in the spreadsheet is not currently supported. There
is no workaround for this either - the black book does have a hack approach
if you absolutely must implement this functionality.

You can call the rangefrompoint, or valuefrompoint method to get the object
underneath the cursor. If you assume it is a range object, then you can cast
the range object from the return value to figure out the range address. but
like i said, if you intend to place something other than text in there, it
will all be for naught.

--
Regards,
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc, Amazon, B&H etc


Forth-coming VSTO.NET
 
R

Ran

Hi Alvin,

Thanks for answering my query.
before you go off coding the world, what do you intend to do with that
image? Embedding images in the spreadsheet is not currently supported.

Not intending to embed image in the spreadsheet. As the user drag and
drop a particular type of object, I will be changing the text and cell
color of the underlying row or column. Therefore i would have to
translate the x,y values (from dragdrop event of spreadsheet) into row
and columns.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top