+ Reply to Thread
Results 1 to 8 of 8

Creating Custom Button Image

Hybrid View

glen.comerford Creating Custom Button Image 11-21-2010, 04:05 PM
martindwilson Re: Creating Custom Button... 11-21-2010, 08:59 PM
royUK Re: Creating Custom Button... 11-22-2010, 02:25 AM
Andy Pope Re: Creating Custom Button... 11-22-2010, 06:10 AM
glen.comerford Re: Creating Custom Button... 11-23-2010, 03:27 PM
glen.comerford Re: Creating Custom Button... 11-23-2010, 03:33 PM
Andy Pope Re: Creating Custom Button... 11-24-2010, 06:41 AM
glen.comerford Re: Creating Custom Button... 11-30-2010, 04:10 PM
  1. #1
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Creating Custom Button Image

    What are the limitations that you have encountered?
    Cheers
    Andy
    www.andypope.info

  2. #2
    Registered User
    Join Date
    11-21-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    5

    Smile Re: Creating Custom Button Image

    HI all,

    I tried copying a picture into the add in file i created and wrote a script to paste that picture as a button image every time the add-in opens (i.e. when excel is loaded after the add in is installed) . However, since the image is copied in the clipboard, whenever a user performs a first operation on a sheet as "paste", the picture gets pasted in the current working (new)sheet. I'm looking for another way!

  3. #3
    Registered User
    Join Date
    11-21-2010
    Location
    Sydney
    MS-Off Ver
    Excel 2003
    Posts
    5

    Smile Re: Creating Custom Button Image

    Also, since I need to install the add-in on multiple computers, I need to be able to change the image right in the source add-in file!

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,482

    Re: Creating Custom Button Image

    So maybe the solution is to clear the clipboard after pasting your image.

    Private Declare Function EmptyClipboard Lib "user32" () As Long
    Private Declare Function CloseClipboard Lib "user32" () As Long
    Private Declare Function OpenClipboard Lib "user32" (ByVal hWnd As Long) As Long
    Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
    
    Sub ClearClipboard()
        Dim lngHWnd As Long
        
        lngHWnd = FindWindow("XLMAIN", Application.Caption)
        OpenClipboard lngHWnd
        EmptyClipboard
        CloseClipboard
    
    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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