+ Reply to Thread
Results 1 to 2 of 2

Programmatically put an image on a button

  1. #1
    quartz
    Guest

    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. #2
    Tom Ogilvy
    Guest

    RE: 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1