ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro to insert pictures in comments (https://www.excelbanter.com/excel-discussion-misc-queries/450518-macro-insert-pictures-comments.html)

Zafar Iqbal

Macro to insert pictures in comments
 
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

GS[_2_]

Macro to insert pictures in comments
 
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



Zafar Iqbal

Macro to insert pictures in comments
 
Surely I already tried it and got Run Time Error '70': Permission Denied. I think 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.

GS[_2_]

Macro to insert pictures in comments
 
Picture needs to be rotated in temporary place or memory and then
then pasted in cell comments.


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



Zafar Iqbal

Macro to insert pictures in comments
 
On Sunday, 14 December 2014 07:21:29 UTC+3, GS wrote:
Picture needs to be rotated in temporary place or memory and then
then pasted in cell comments.


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.

GS[_2_]

Macro to insert pictures in comments
 
On Sunday, 14 December 2014 07:21:29 UTC+3, GS wrote:
Picture needs to be rotated in temporary place or memory and then
then pasted in cell comments.


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.


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



Zafar Iqbal

Macro to insert pictures in comments
 
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

On Sunday, 14 December 2014 21:29:32 UTC+3, GS wrote:
On Sunday, 14 December 2014 07:21:29 UTC+3, GS wrote:
Picture needs to be rotated in temporary place or memory and then
then pasted in cell comments.

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.


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



GS[_2_]

Macro to insert pictures in comments
 
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


Like I said.., I use Office Picture Manager for this because it's the
easiest way IMO when dealing with multiple images. If I had a VB[A]
solution that works I'd share it with you! Perhaps someone else here
has something to offer because I don't have the energy/time to *spend*
on this. (I have Lou Gehrig's and demands on my time/energy are maxed
out right now, ..sorry!)

--
Garry

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



GS[_2_]

Macro to insert pictures in comments
 
I googled...

VB6 rotate image

...and got 364,000 results! I clicked on this link to find it contains
the code you need to do this via VB[A]...

http://support.microsoft.com/kb/186260

...and so now you'll see why I found it easier to use OPM!

--
Garry

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



Zafar Iqbal

Macro to insert pictures in comments
 
Thanks for it.

On Monday, 15 December 2014 18:43:55 UTC+3, GS wrote:
I googled...

VB6 rotate image

..and got 364,000 results! I clicked on this link to find it contains
the code you need to do this via VB[A]...

http://support.microsoft.com/kb/186260

..and so now you'll see why I found it easier to use OPM!

--
Garry

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




All times are GMT +1. The time now is 12:57 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com