Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Putting an image into the clipboard

i am trying to create a custom icon for a custom control
button. I have gone through all of the knowledgebase
articles about how to do this and have copied the code
into my module but I always get to the part where it tell
me to put the image into the clipboard by using the
Clipboard.SetData command. Well, it never works, I have
tried:

Dim MyIcon as StdPicture
Set MyIcon = LoadPicture("C:\someiconfile")
Clipboard.SetData MyIcon

the LoadPicture seems to work but when I get to the
Clipboard line it tells me "Object Required". I have tried
all of the variations I can think of
Cliboard.SetData MyIcon, 2
MyIcon.PutInClipboard

Nothing seems to work. Any ideas?

From there I think it will be pretty easy to do a
PasteFace onto the control button.

thanks,
jonathan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 620
Default Putting an image into the clipboard

Jonathan,

I load the pictures onto a hidden worksheet, and then just use the PasteFace
method to get them by name. Far easier than all that you are going through.

--

HTH

Bob Phillips

"Jonathan Crow" wrote in message
...
i am trying to create a custom icon for a custom control
button. I have gone through all of the knowledgebase
articles about how to do this and have copied the code
into my module but I always get to the part where it tell
me to put the image into the clipboard by using the
Clipboard.SetData command. Well, it never works, I have
tried:

Dim MyIcon as StdPicture
Set MyIcon = LoadPicture("C:\someiconfile")
Clipboard.SetData MyIcon

the LoadPicture seems to work but when I get to the
Clipboard line it tells me "Object Required". I have tried
all of the variations I can think of
Cliboard.SetData MyIcon, 2
MyIcon.PutInClipboard

Nothing seems to work. Any ideas?

From there I think it will be pretty easy to do a
PasteFace onto the control button.

thanks,
jonathan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Putting an image into the clipboard

Turn on the macro recorder while you do Insert=Picture in the menu to get
your picture on the worksheet. Then select the picture and do Edit=Copy.
That gets it on the clipboard. Now you can do customize, select the button
and do PasteFace. Turn off the macro recorder.

Just to add a little more detail.

--
Regards,
Tom Ogilvy

Bob Phillips wrote in message
...
Jonathan,

I load the pictures onto a hidden worksheet, and then just use the

PasteFace
method to get them by name. Far easier than all that you are going

through.

--

HTH

Bob Phillips

"Jonathan Crow" wrote in message
...
i am trying to create a custom icon for a custom control
button. I have gone through all of the knowledgebase
articles about how to do this and have copied the code
into my module but I always get to the part where it tell
me to put the image into the clipboard by using the
Clipboard.SetData command. Well, it never works, I have
tried:

Dim MyIcon as StdPicture
Set MyIcon = LoadPicture("C:\someiconfile")
Clipboard.SetData MyIcon

the LoadPicture seems to work but when I get to the
Clipboard line it tells me "Object Required". I have tried
all of the variations I can think of
Cliboard.SetData MyIcon, 2
MyIcon.PutInClipboard

Nothing seems to work. Any ideas?

From there I think it will be pretty easy to do a
PasteFace onto the control button.

thanks,
jonathan





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
Where does Ms XL store the clipboard ? or where does MS Windowsstore clipboard ? Subu Setting up and Configuration of Excel 0 May 5th 09 01:20 PM
Saving clipboard image as BMP through VBA in Excel Elliot Excel Discussion (Misc queries) 0 September 17th 08 03:22 AM
Clipboard empty but still get waring that clipboard is full Steve Excel Discussion (Misc queries) 0 June 17th 08 09:05 PM
Hyperlink to an image in other worksheet, displaying entire image. twilliams Excel Worksheet Functions 0 February 7th 06 10:02 PM
Need to turn off prompt about putting on clipboard or not... KyWilde Excel Discussion (Misc queries) 0 April 27th 05 11:37 PM


All times are GMT +1. The time now is 01:03 AM.

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"