|
-
May 7th, 2006, 02:29 PM
#1
Thread Starter
Addicted Member
RESOLVED[Insert a Picture in a UserForm from a Worsheet]
I want to insert a picture in a UserForm. However this picte is already located in a worksheet of the workbook. How can I do this?
Last edited by Fonty; May 18th, 2006 at 12:41 PM.
-
May 7th, 2006, 02:36 PM
#2
Re: Insert a Picture in a UserForm from a Worsheet
Welcome to the Forums.
Is your picture an Inlineshape or an OLEObject?
You would reference which ever it is and add a Image control to your userform and set the Picture property to the referenced image.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 7th, 2006, 02:49 PM
#3
Thread Starter
Addicted Member
Re: Insert a Picture in a UserForm from a Worsheet
What is the difference between an Inlineshape or an OLEObject?
I have two differente pictures I would like to insert. One is a jpg picture that is in the worksheet and the other one is a drawring I made with the drawing tools in Excel.
-
May 7th, 2006, 03:05 PM
#4
Re: Insert a Picture in a UserForm from a Worsheet
Did you do an Insert Image from the Insert menu or created the image/shape from the drawing oolbar? Te only difference is how we will access and reference the image.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 7th, 2006, 03:29 PM
#5
Thread Starter
Addicted Member
Re: Insert a Picture in a UserForm from a Worsheet
I have both. One inserted in the worksheet using the Insert Image and one created with the drawing toolbar. And I'd like to use both images.
-
May 7th, 2006, 04:13 PM
#6
Re: Insert a Picture in a UserForm from a Worsheet
The one that is from the insert image is a Shape or OLEObject.
You can reference it but not the image or picture property.
VB Code:
ThisWorkbook.Sheets("Sheet1").Shapes(1)
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 7th, 2006, 04:22 PM
#7
Thread Starter
Addicted Member
Re: Insert a Picture in a UserForm from a Worsheet
Yes. In fact I'm able to manipulate them on the sheet. I have for example:
VB Code:
ActiveSheet.Shapes(tipogas).Visible = True
Where tipogas was a String I defined. However my issue is to be able to see an Image displayed in the UserForm. I want to put 5 different option buttons and the picture to which each option is reffered to upon the button.
-
May 7th, 2006, 06:14 PM
#8
Re: Insert a Picture in a UserForm from a Worsheet
Hi Fonty
i remember reading a same problem earlier so i just searched the web and finally found it
Click the link below and read the solution given by Stephen Bullen.
http://groups.google.co.in/group/mic...305eb70bd975c7
Hope this helps...
-
May 8th, 2006, 08:51 AM
#9
Re: Insert a Picture in a UserForm from a Worsheet
Have a look at my code in the following thread for the PastePicture function. In this case it is used to copy a Chart picture to a UserFrom, but could also be used to copy any picture.
http://www.vbforums.com/showthread.php?t=402588
Declan
Don't forget to mark your Thread as resolved.
Take a moment to rate posts that you think are helpful 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|