Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 441
Default Programmatically put an image on a button

I am using Office 2003 on Win XP.

I have coded a program that adds an ActiveX button (OLEObject) on a
spreadsheet. Now I want to place an image on the surface of the button, which
I can do manually, but the macro recorder doesn't pick up the keystrokes.

Can someone please provide some example code that adds an image?

Thanks much in advance.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Programmatically put an image on a button

Sub abc()
s = "C:\Documents and Settings\" & _
"OgilvyTW\My Documents\My Pictures\sample.jpg"
ActiveSheet.CommandButton1.Picture = LoadPicture(s)
End Sub

--
Regards,
Tom Ogilvy


"quartz" wrote:

I am using Office 2003 on Win XP.

I have coded a program that adds an ActiveX button (OLEObject) on a
spreadsheet. Now I want to place an image on the surface of the button, which
I can do manually, but the macro recorder doesn't pick up the keystrokes.

Can someone please provide some example code that adds an image?

Thanks much in advance.

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
add button to UserForm programmatically [email protected] Excel Programming 2 May 1st 06 01:06 PM
How to add an image to a worksheet programmatically mjohnson Excel Discussion (Misc queries) 2 March 16th 05 04:48 PM
How to save a bar chart as an image file programmatically? Fool Excel Programming 1 August 2nd 04 01:35 PM
Who can tell me how to programmatically insert an image into Excel by C#? syf Excel Programming 0 January 13th 04 10:29 AM
how to add code programmatically to a macro for a button Tina Excel Programming 0 August 26th 03 03:30 AM


All times are GMT +1. The time now is 05:08 PM.

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

About Us

"It's about Microsoft Excel"