Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Evanbron
 
Posts: n/a
Default How do I insert a PictureBox into Excel?

I don't know much about VBA. Is there any way to easily insert a PictureBox
into an Excel worksheet so that a .jpg file can be selected from a directory
of .jpg files and loaded to the worksheet?

Thanks,

Evanbron
  #2   Report Post  
exceluserforeman
 
Posts: n/a
Default How do I insert a PictureBox into Excel?

Hi,
Just off-hand, You could use a userform with an image control, a list box
with a list of the picture locations and a button to insert picture into the
image control. If the desired pictured is acceptable, use another button to
insert the picture into the worksheet.

If you would like me to create this project for you, you can send me the
relevant info.
See my user stuff at http://www.geocities.com/excelmarksway

- Mark
PS I just might do it anyhow and post it to my Excel site in a couple of
days...

"Evanbron" wrote:

I don't know much about VBA. Is there any way to easily insert a PictureBox
into an Excel worksheet so that a .jpg file can be selected from a directory
of .jpg files and loaded to the worksheet?

Thanks,

Evanbron

  #3   Report Post  
Rowan Drummond
 
Posts: n/a
Default How do I insert a PictureBox into Excel?

This will place the picture on the sheet at the currently selected cell.

Sub JPeg()
Dim flname As Variant
flname = Application.GetOpenFilename
If flname < False Then
If Right(flname, 3) = "jpg" Then
ActiveSheet.Pictures.Insert (flname)
Else
MsgBox "That is not a jpeg file"
End If
End If
End Sub

Hope this helps
Rowan

Evanbron wrote:
I don't know much about VBA. Is there any way to easily insert a PictureBox
into an Excel worksheet so that a .jpg file can be selected from a directory
of .jpg files and loaded to the worksheet?

Thanks,

Evanbron

  #4   Report Post  
exceluserforeman
 
Posts: n/a
Default How do I insert a PictureBox into Excel?

Hi,
Rowan's answer is good. I have implemented the same macro to a userform
utility.
Here is how it works:
Click the Open Folder Picture button to show the Open Dialog
Click Cancel when you have found the Folder you want. The Open Dialog does
not open any files should you click the OPEN button.
The file types have been preset in the Open Dialog.
The Folder Location textbox shows your selected Folder of Picture Files.
The File Type combobox shows you the type of file types allowed for the
image control.
The Files in the Current Folder listbox shows the compatible files. Click an
item in the listbox to load it into the image control.
Insert Picture button inserts the selected picture into the current active
worksheet.
The Hide Pic Box button allows you to hide the main form so you can get a
better view of the inserted picture. A small form is shown at the Top-Left of
your screen so you can reload the main form when you are ready.
Also, I have resized the picture to approx. 1/3 the original size. Good for
large pictures, no good if you import an icon or small picture...
You can download it from http://www.geocities.com/excelmarksway

24 October 2005

"Evanbron" wrote:

I don't know much about VBA. Is there any way to easily insert a PictureBox
into an Excel worksheet so that a .jpg file can be selected from a directory
of .jpg files and loaded to the worksheet?

Thanks,

Evanbron

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
MS EXCEL does not let me insert a column sharmila Excel Discussion (Misc queries) 2 August 15th 05 10:29 PM
Excel 2002 "Protect Sheet", but Allow "Insert Comments"? VP Safe Excel Worksheet Functions 2 July 5th 05 07:18 PM
Excel Range Value issue (Excel 97 Vs Excel 2003) Keeno Excel Discussion (Misc queries) 2 June 13th 05 02:01 PM
insert field from Word into Excel Kaththea Excel Worksheet Functions 6 June 8th 05 06:56 PM
Insert Function "FX" on Toolbar in Excel Rich Excel Discussion (Misc queries) 4 January 16th 05 03:04 PM


All times are GMT +1. The time now is 05:24 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"