+ Reply to Thread
Results 1 to 6 of 6

Picture change

Hybrid View

rbyrd023 Picture change 06-21-2010, 04:33 PM
Leith Ross Re: Problem with picture... 06-21-2010, 05:34 PM
rbyrd023 Re: Problem with picture... 06-21-2010, 05:51 PM
Leith Ross Re: Problem with picture... 06-21-2010, 06:09 PM
rbyrd023 Re: Picture change 06-21-2010, 08:02 PM
rbyrd023 Re: Picture change 06-22-2010, 09:15 AM
  1. #1
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Picture change

    Hello! I have a form that I want the end user to be able to change the picture (logo). I've gotten the open file dialog box but I cannot complete the "transfer"

    Could someone please help!
    Attached Files Attached Files

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Problem with picture change

    Hello rbyrd023,

    Here is the corrected code...
    Sub changelogo_Click()
    
      cngpic = Application.GetOpenFilename(Title:="Select an image to load", FileFilter:="Picture Files *.gif(*.gif),")
    
      If cngpic = False Then
        MsgBox "You did not load an image"
        Exit Sub 
      End If
       
      companylogo.Picture = LoadPicture(cngpic)
    
    End Sub
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Problem with picture change

    Wow! Thank you! That seemed very easy! Now lets say I wanted that same pic to show on a worksheet. how would you code that!

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: Problem with picture change

    Hello rbyrd023,

    I am not sure this what you want, but this code will set the background for the worksheet
      cngpic = Application.GetOpenFilename(Title:="Select an image to load", FileFilter:="Picture Files *.gif(*.gif),")
    
      If cngpic = False Then
        MsgBox "You did not load an image"
        Exit Sub 
      End If
       
      ActiveSheet.SetBackgroundPicture cngpic
    .

  5. #5
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Picture change

    I have attached another file with what I want.

    Thanks for your help!
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    04-04-2009
    Location
    Nashville, TN,USA
    MS-Off Ver
    Excel 2007
    Posts
    87

    Re: Picture change

    Anyone find anything? I worked on it all night and couldn't think of anything! Whats worse is it's prob. something very simple!

+ 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