Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default Insert Pic Which User Chooses into Comment

I have this code...but I need to edit this code so the Insert Picture
Dialog box comes up and the user finds the picture...not how it
currently reads...this would automatically put a picture in without a
users choice....

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 4/26/2007
'

'
Range("O3").Select
Range("O3").AddComment
Range("O3").Comment.Visible = False
Range("O3").Comment.Text Text:="meps2_spokane:" & Chr(10) & ""
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.BackColor.SchemeColor = 80
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Fill.UserPicture "C:\Galleries\Main Gallery
\Pict0225.JPG" *****Here is where I need the user to choose, not
this pic????********
Selection.ShapeRange.ScaleWidth 0.29, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.47, msoFalse,
msoScaleFromTopLeft
End Sub

Any help is appreciated, thank you.
Bull

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Insert Pic Which User Chooses into Comment

fname = Application.GetOpenFilename()
Selection.ShapeRange.Fill.UserPicture fName

see help on GetOpenFilename for addtional arguments
also you can add some if statements to test what the user has chosen before
you try to use it with the UserPicture command.

--
Regards,
Tom Ogilvy


"Bull" wrote:

I have this code...but I need to edit this code so the Insert Picture
Dialog box comes up and the user finds the picture...not how it
currently reads...this would automatically put a picture in without a
users choice....

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 4/26/2007
'

'
Range("O3").Select
Range("O3").AddComment
Range("O3").Comment.Visible = False
Range("O3").Comment.Text Text:="meps2_spokane:" & Chr(10) & ""
Selection.ShapeRange.Line.Weight = 0.75
Selection.ShapeRange.Line.DashStyle = msoLineSolid
Selection.ShapeRange.Line.Style = msoLineSingle
Selection.ShapeRange.Line.Transparency = 0#
Selection.ShapeRange.Line.Visible = msoTrue
Selection.ShapeRange.Line.ForeColor.RGB = RGB(0, 0, 0)
Selection.ShapeRange.Line.BackColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.Visible = msoTrue
Selection.ShapeRange.Fill.ForeColor.RGB = RGB(255, 255, 255)
Selection.ShapeRange.Fill.BackColor.SchemeColor = 80
Selection.ShapeRange.Fill.Transparency = 0#
Selection.ShapeRange.Fill.UserPicture "C:\Galleries\Main Gallery
\Pict0225.JPG" *****Here is where I need the user to choose, not
this pic????********
Selection.ShapeRange.ScaleWidth 0.29, msoFalse,
msoScaleFromTopLeft
Selection.ShapeRange.ScaleHeight 0.47, msoFalse,
msoScaleFromTopLeft
End Sub

Any help is appreciated, thank you.
Bull


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
Data validation list decreases as the user chooses from the list/s Emdyey Excel Discussion (Misc queries) 1 September 9th 08 01:37 PM
Add User to comment Nimish Excel Discussion (Misc queries) 0 August 17th 06 08:41 PM
Subtotal formulas that chooses values mikeburg Excel Discussion (Misc queries) 2 January 24th 06 09:20 PM
How do I insert a comment when the Insert:Comment menu is greyed? none Excel Discussion (Misc queries) 0 May 19th 05 12:36 AM
how do I insert a function that chooses between two text values? Gailwdz Excel Worksheet Functions 5 May 4th 05 07:36 AM


All times are GMT +1. The time now is 04:53 PM.

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"