Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 17th, 2016, 08:59 AM
Registered User
 
Join Date: May 2016
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Changing Picture of Shapes("Image1") on Worksheet

Hi.. I have a problem.. why my image (ActiveX Image) not changing..
VBA EXCEL 2007..
thank...


Private Sub LogoButton_Click()

Dim fs As FileDialog, myDir As String, wsLogo As Worksheet

Set fs = Application.FileDialog(msoFileDialogFilePicker)
fs.Title = "Select Your LOGO"

fs.Filters.Clear
fs.Filters.Add "Images", "*.gif; *.jpg; *.jpeg; *.bmp", 1

myDir = ThisWorkbook.Path
Workbooks.Open myDir & "\Logo.xls"
Set wsLogo = Workbooks("Logo").Sheets("LOGO")

If fs.Show = -1 Then
a = fs.SelectedItems(1)
Me.Button.Picture = LoadPicture(a)
Sheet4.Image1.Picture = LoadPicture(a)
wsLogo.Shapes("Image1").Fill.UserPicture a
Workbooks("Logo").Close savechanges:=True
End If

End Sub





Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing DataGridView "Natural" Behavior zaki BOOK: Visual Basic 2012 Programmer's Reference 2 September 6th, 2013 05:14 AM
MSXSL gives error message for "for" inside "select" ilyaz XSLT 1 December 9th, 2010 05:02 PM
How to theme the "Browse" button of "FileUpload" control? varunbwj BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 2 October 14th, 2009 01:22 AM
Add a CheckBox DataColumn to my DataGridView, Null format: "" or "True" but Error: F ismailc C# 2005 0 September 25th, 2009 04:56 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.