Macro to put picture in background

G

Guest

Hi all. I'm new to macros. so bear w/ my stupidity
is this even attemptable for a newbie?
GOAL:
write a macro to put a hard-coded(for now) image into the background of a
hard coded(for now) comment

TRIED:
I recorded the included macro with the following actions:
*1 give cell a comment
*2 select cell border
*3 fill with picture

INTUITION SAYS:
Range("D59").Comment.Fill.UserPicture _ "C:blahblah"

but this gives me an error. is there an intermediate object I need between
comment and fill???

the problem with the included one is that it doesnt run.... it seems to jump
from range to selection. recording scripts never works :-(

Sub Macro1()
'
Range("D59").AddComment
Range("D59").Comment.Visible = False
Range("D59").Comment.Text Text:="USER:" & Chr(10) & ""
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Fill.UserPicture _
"C:\Documents and Settings\Administrator\My Documents\My
Pictures\ART#1\1072.jpg"
End Sub

CHECKED:
forums
google
documentation

office 2003 SBE
 
N

NickHK

Dim Com As Comment

Set Com = Range("A1").AddComment
Com.Shape.Fill.UserPicture _
"C:\PathToFile\pic.jpg"

Set the properties as desired.
You do not need to .select most XL object before you work with them.

NickHK
 

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