Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 104
Default Return Path of selected item from dialogbox

Hi I am using xlDialogInsertPicture from a commandbutton and would like to
capture the path of the user selected image, I have sent a lot of time
looking for an answer can someone please help.
TIA
Charles
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Return Path of selected item from dialogbox

Why not just use application.getopenfilename and get the name (and insert the
picture, too).


Kind of...

Option Explicit
Sub testme()
Dim myPictName As Variant
Dim myPict As Picture
Dim wks As Worksheet

Set wks = Worksheets("sheet1")

myPictName _
= Application.GetOpenFilename("Picture files, *.bmp;*.jpg;*.gif")
If myPictName = False Then
MsgBox "try later!"
Exit Sub
End If

With wks
With .Range("a1:B9")
Set myPict = .Parent.Pictures.Insert(myPictName)
myPict.Top = .Top
myPict.Left = .Left
myPict.Width = .Width
myPict.Height = .Height
End With
End With

End Sub


vqthomf wrote:

Hi I am using xlDialogInsertPicture from a commandbutton and would like to
capture the path of the user selected image, I have sent a lot of time
looking for an answer can someone please help.
TIA
Charles


--

Dave Peterson
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
Open Dialog Box to return Selected File Path and Not Open it. DMS Excel Programming 4 January 26th 10 12:46 PM
Excluding VAT for selected item triffidbook Excel Worksheet Functions 4 September 7th 06 08:20 AM
Return key to "OK" a DialogBox donbowyer Excel Programming 2 November 4th 05 12:52 AM
ComboBox fails when last item selected first MBlake[_2_] Excel Programming 2 July 28th 05 07:51 PM
Highlighting ser selected item! aiyer[_16_] Excel Programming 1 May 10th 04 08:33 PM


All times are GMT +1. The time now is 07:56 PM.

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

About Us

"It's about Microsoft Excel"