Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Was wondering if there was a way to do this????
This is what I have to display a selected picture in a UserForm: Image1.Picture = LoadPicture("I:\2004 Yankees Schedule\Logos\" & _ Label1.Caption & ".jpg") With the above, I can display the .jpg that's associated with the caption in Label1. If Label1.Caption = "Oakland", it'll display the oakland.jpg as the Image picture. What I'd like to be able to do is have those .jpg's included in the workbook and still be able to achieve the same functionality. Not worried about the size of the workbook as all 30 jpg's only add up to about 180 kB. Any ideas?? Thanks, John |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You might have a look at Stephen Bullen's site and see the code for the
pastepicture.zip file http://www.bmsltd.ie/Excel/Default.htm look all the way down under the VBA section. Here is the writeup. Sounds like what you want to do - paste from the clipboard into an image control. The userforms in Excel 97 are great, apart from one BIG letdown - you can't put charts on them! A kludgy workaround has been to export the chart as a gif or jpg, then load it into an Image control using LoadPicture. That works ok-ish for charts, but it can't handle word art, shapes or other pictures created on the fly. This file includes code to create a Picture object from whatever is on the clipboard. Display a chart on a userform is now as easy as a copy/paste. Thanks to VB MVPs Karl Peterson, Randy Birch and Brad Martinez for their help. You can paste the image as either a bitmap (better for same-size copies) or a metafile (better when zooming/stretching), whichever best suits your circumstances. This update includes an example of saving the picture to disk as a bitmap or metafile. -- Regards, Tom Ogilvy "John Wilson" wrote in message ... Was wondering if there was a way to do this???? This is what I have to display a selected picture in a UserForm: Image1.Picture = LoadPicture("I:\2004 Yankees Schedule\Logos\" & _ Label1.Caption & ".jpg") With the above, I can display the .jpg that's associated with the caption in Label1. If Label1.Caption = "Oakland", it'll display the oakland.jpg as the Image picture. What I'd like to be able to do is have those .jpg's included in the workbook and still be able to achieve the same functionality. Not worried about the size of the workbook as all 30 jpg's only add up to about 180 kB. Any ideas?? Thanks, John |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
I tried Steve's file and still can't get this to work. There is the distinct possibility that some of my synapses aren't firing correctly. Would've thought that it would be easier to link an Image control to a picture saved directly in the workbook than it would be to link to a picture somewhere on the hard drive but obviously, that isn't the case. :-( Forgetting the fact that I would want to change these pictures programmatically, how would I link a single embedded picture to an image control on a UserForm? Example: Took a small picture. Copied and pasted it from "Paint" to Sheet1 of a workbook. Excel named it "Object 1" and the formula bar shows it as =EMBED("Paint.Picture","") How do I get that Picture, Object, OLEObject, whatever the heck it is to display on Image1 in UserForm1??? Thanks, John "Tom Ogilvy" wrote in message ... You might have a look at Stephen Bullen's site and see the code for the pastepicture.zip file http://www.bmsltd.ie/Excel/Default.htm look all the way down under the VBA section. Here is the writeup. Sounds like what you want to do - paste from the clipboard into an image control. The userforms in Excel 97 are great, apart from one BIG letdown - you can't put charts on them! A kludgy workaround has been to export the chart as a gif or jpg, then load it into an Image control using LoadPicture. That works ok-ish for charts, but it can't handle word art, shapes or other pictures created on the fly. This file includes code to create a Picture object from whatever is on the clipboard. Display a chart on a userform is now as easy as a copy/paste. Thanks to VB MVPs Karl Peterson, Randy Birch and Brad Martinez for their help. You can paste the image as either a bitmap (better for same-size copies) or a metafile (better when zooming/stretching), whichever best suits your circumstances. This update includes an example of saving the picture to disk as a bitmap or metafile. -- Regards, Tom Ogilvy "John Wilson" wrote in message ... Was wondering if there was a way to do this???? This is what I have to display a selected picture in a UserForm: Image1.Picture = LoadPicture("I:\2004 Yankees Schedule\Logos\" & _ Label1.Caption & ".jpg") With the above, I can display the .jpg that's associated with the caption in Label1. If Label1.Caption = "Oakland", it'll display the oakland.jpg as the Image picture. What I'd like to be able to do is have those .jpg's included in the workbook and still be able to achieve the same functionality. Not worried about the size of the workbook as all 30 jpg's only add up to about 180 kB. Any ideas?? Thanks, John |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Tom,
Reconnected a few (not all) of my synapses, cleansed them with some alchohol (drinking, not rubbing) and got it to work using Stephen's coding. Thanks, John "John Wilson" wrote in message ... Tom, I tried Steve's file and still can't get this to work. There is the distinct possibility that some of my synapses aren't firing correctly. Would've thought that it would be easier to link an Image control to a picture saved directly in the workbook than it would be to link to a picture somewhere on the hard drive but obviously, that isn't the case. :-( Forgetting the fact that I would want to change these pictures programmatically, how would I link a single embedded picture to an image control on a UserForm? Example: Took a small picture. Copied and pasted it from "Paint" to Sheet1 of a workbook. Excel named it "Object 1" and the formula bar shows it as =EMBED("Paint.Picture","") How do I get that Picture, Object, OLEObject, whatever the heck it is to display on Image1 in UserForm1??? Thanks, John "Tom Ogilvy" wrote in message ... You might have a look at Stephen Bullen's site and see the code for the pastepicture.zip file http://www.bmsltd.ie/Excel/Default.htm look all the way down under the VBA section. Here is the writeup. Sounds like what you want to do - paste from the clipboard into an image control. The userforms in Excel 97 are great, apart from one BIG letdown - you can't put charts on them! A kludgy workaround has been to export the chart as a gif or jpg, then load it into an Image control using LoadPicture. That works ok-ish for charts, but it can't handle word art, shapes or other pictures created on the fly. This file includes code to create a Picture object from whatever is on the clipboard. Display a chart on a userform is now as easy as a copy/paste. Thanks to VB MVPs Karl Peterson, Randy Birch and Brad Martinez for their help. You can paste the image as either a bitmap (better for same-size copies) or a metafile (better when zooming/stretching), whichever best suits your circumstances. This update includes an example of saving the picture to disk as a bitmap or metafile. -- Regards, Tom Ogilvy "John Wilson" wrote in message ... Was wondering if there was a way to do this???? This is what I have to display a selected picture in a UserForm: Image1.Picture = LoadPicture("I:\2004 Yankees Schedule\Logos\" & _ Label1.Caption & ".jpg") With the above, I can display the .jpg that's associated with the caption in Label1. If Label1.Caption = "Oakland", it'll display the oakland.jpg as the Image picture. What I'd like to be able to do is have those .jpg's included in the workbook and still be able to achieve the same functionality. Not worried about the size of the workbook as all 30 jpg's only add up to about 180 kB. Any ideas?? Thanks, John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I embed pictures into a table that is sortable? | Excel Discussion (Misc queries) | |||
How do I embed a pictures to a excell spreadsheet cell | New Users to Excel | |||
Is it possible to embed pictures or graphics in Excel? | Excel Discussion (Misc queries) | |||
Is it possible to embed pictures or graphics in Excel? | Excel Discussion (Misc queries) | |||
how do I embed/Link pictures onto excel database cells? | Excel Discussion (Misc queries) |