Macro to insert pictures in comments

Z

Zafar Iqbal

Dear Experts,
I got a Excel macro to paste pictures in Excel cell comments. It is working fine. Now, I need a change in it. Pictures should be rotated 270 degree & then pasted in cell comments. Can anybody help, please? Thanks in advance. code is mentioned below:-

Sub InsertPictures()
Dim cll As Range
Dim Rng As Range
Dim strPath As String
strPath = "D:\Photo Folder"
With Sheets("Sheet1")
Set Rng = Range("A2:A416")
End With
For Each cll In Rng
If Dir$(strPath & "\" & cll.Value & ".jpg") <> "" Then
With cll
.ClearComments
.AddComment ("")
.Comment.Shape.Fill.UserPicture (strPath & "\" & cll.Value & ".jpg")
.Comment.Shape.Height = 160
.Comment.Shape.Width = 120
.Comment.Shape.LockAspectRatio = msoTrue
End With
End If
Next cll
End Sub
 
G

GS

Dear Experts,
I got a Excel macro to paste pictures in Excel cell comments. It is
working fine. Now, I need a change in it. Pictures should be rotated
270 degree & then pasted in cell comments. Can anybody help, please?
Thanks in advance. code is mentioned below:-

Sub InsertPictures()
Dim cll As Range
Dim Rng As Range
Dim strPath As String
strPath = "D:\Photo Folder"
With Sheets("Sheet1")
Set Rng = Range("A2:A416")
End With
For Each cll In Rng
If Dir$(strPath & "\" & cll.Value & ".jpg") <> "" Then
With cll
.ClearComments
.AddComment ("")
.Comment.Shape.Fill.UserPicture (strPath & "\" &
cll.Value & ".jpg") .Comment.Shape.Height = 160
.Comment.Shape.Width = 120
.Comment.Shape.LockAspectRatio = msoTrue
End With
End If
Next cll
End Sub

Clearly you did not use the Object Browser to see if a 'Rotation'
property exists, did you?

Why not...

.Comment.Shape.Rotation = 0.00

...where '0.00' represents the +/- degrees of rotation.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
Z

Zafar Iqbal

Surely I already tried it and got Run Time Error '70': Permission Denied. Ithink rotation is not allowed for picture in cell comments. Picture needs to be rotated in temporary place or memory and then then pasted in cell comments. Thanks for your attention.
 
Z

Zafar Iqbal

This is what I suspected, anyway, and so thanks for confirming...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion

Kindly help me to resolve this matter. I have lot of pictures & their manual rotation is a tremendous work. Thanks for your support in advance.
 
G

GS

Kindly help me to resolve this matter. I have lot of pictures & their
manual rotation is a tremendous work. Thanks for your support in
advance.

I use Office Picture Manager to manipulate any images I use that don't
require special treatment such as I would do in Paint Shop Pro or Robo
Screen Capture. OPM will allow you to multiselect images for most user
actions, meaning you could likely select groups of image files and
rotate them all at once, but I've done performed that action and so
can't confirm this ability!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
 
Z

Zafar Iqbal

Dear Mr. Garry,

I agree with you that photo softwares can rotate images. I have +600 picture which need to be rotated before pasting in cell comments. Surely excel vba will help in rotating imagines. Experts like you know it well. Kindly spare sometime to resolve my task with VBA macro. Thanks
 

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