Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to got the position of a cell/range in pixels (from the left-top corner) ?


Hi everybody,

I am new to programming in Excel and can't get any further with the
following problem:

What i want to chieve is to insert a picture "into" a specific "cell"
(range) in my worksheet.
I have found the function: AddPicture(Filename As String, LinkToFile As
MsoTriState, SaveWithDocument As MsoTriState, Left As Single, Top As
Single, Width As Single, Height As Single) As Shape

In the help it says that to define the position I need to know the
pixels from the left-top corner:
- Left Required Single. The position (in points) of the upper-left
corner of the picture relative to the upper-left corner of the
document.
-Top Required Single. The position (in points) of the upper-left
corner of the picture relative to the top of the document.

This functionality would be really great for me.
However the problem is that I don't have the position in pixels.
I only know the cell-coordinates (ex. "2/25" or "B25" )

Does anybody know how to find out the position in pixels for a given
cell or a range ?

Thanks in advance for any help.

Bye

Char


--
charon1999
------------------------------------------------------------------------
charon1999's Profile: http://www.excelforum.com/member.php...o&userid=25886
View this thread: http://www.excelforum.com/showthread...hreadid=392720

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default How to got the position of a cell/range in pixels (from the left-top corner) ?

Charon,

A cell has a top and left property tyhat you can use, loike so

Dim myDocument As Worksheet
Set myDocument = Worksheets(1)
myDocument.Shapes.AddPicture _
"C:\Documents and Settings\Bob\My Documents\My
Pictures\classic_beetle.jpg", _
True, True, Range("B25").Left, Range("B25").Top, 70, 70


--

HTH

RP
(remove nothere from the email address if mailing direct)


"charon1999" wrote
in message ...

Hi everybody,

I am new to programming in Excel and can't get any further with the
following problem:

What i want to chieve is to insert a picture "into" a specific "cell"
(range) in my worksheet.
I have found the function: AddPicture(Filename As String, LinkToFile As
MsoTriState, SaveWithDocument As MsoTriState, Left As Single, Top As
Single, Width As Single, Height As Single) As Shape

In the help it says that to define the position I need to know the
pixels from the left-top corner:
- Left Required Single. The position (in points) of the upper-left
corner of the picture relative to the upper-left corner of the
document.
-Top Required Single. The position (in points) of the upper-left
corner of the picture relative to the top of the document.

This functionality would be really great for me.
However the problem is that I don't have the position in pixels.
I only know the cell-coordinates (ex. "2/25" or "B25" )

Does anybody know how to find out the position in pixels for a given
cell or a range ?

Thanks in advance for any help.

Bye

Char


--
charon1999
------------------------------------------------------------------------
charon1999's Profile:

http://www.excelforum.com/member.php...o&userid=25886
View this thread: http://www.excelforum.com/showthread...hreadid=392720



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
GREEN MARK IN THE TOP LEFT CORNER OF THE CELL leo Excel Worksheet Functions 1 June 21st 07 10:55 PM
grey dot in left upper corner of cell singnothing Excel Discussion (Misc queries) 1 April 1st 06 10:06 AM
Put a CommandBar on the left up corner of a cell Andoni[_15_] Excel Programming 1 August 9th 04 02:28 PM
How to get ID of the Cell on the Left-Top corner of a worksheet LamNgo Excel Programming 3 May 20th 04 11:47 AM
Cell A1 in Upper Left Corner pjhageman[_6_] Excel Programming 3 January 10th 04 08:56 PM


All times are GMT +1. The time now is 03:53 AM.

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

About Us

"It's about Microsoft Excel"