Mourning the loss of our friend, WhitPhil.
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
Search
 
Business Applications
Tag Cloud
access audio black screen blue screen boot bsod connection crash desktop driver drivers dvd email error excel firefox hard drive hardware hijackthis internet keyboard laptop malware monitor motherboard network networking outlook problem processor recovery router safe mode screen slow sound spyware tdlwsp.dll trojan upgrade vba video virus vista vundo windows windows 7 windows vista windows xp wireless
Search
Search for:
Tech Support Guy Forums > Software & Hardware > Business Applications >
Solved: Excel 2007 -> Command Button

Tip: Click here to scan for System Errors and Optimize PC performance
[ Sponsored Link ]

 
Thread Tools
computerman29642's Avatar
Computer Specs
Distinguished Member with 2,640 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
05-Nov-2009, 11:02 AM #1
Question Solved: Excel 2007 -> Command Button
I have placed a command button on one of my worksheets. The command button is used to place an image on the worksheet.

I would like to set the command button's property Enabled to false once it has inserted the image on the worksheet. However, I am unable to figure out how to do that through code.

Also, is there a way through code to determine if teh image was inserted?
__________________
Computerman29642
"I can do all things through Christ which strengtheneth me." (Philippians 4:13)
Rollin_Again's Avatar
Distinguished Member with 3,730 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
05-Nov-2009, 11:29 AM #2
Please post your code that places the image on the worksheet.

Can you also tell us if your command button is from the Forms or Controls Toolbox?

Regards,
Rollin
computerman29642's Avatar
Computer Specs
Distinguished Member with 2,640 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
05-Nov-2009, 12:20 PM #3
Please see the attached file.
Attached Files
File Type: xls Book1.xls (40.5 KB, 12 views)
Rollin_Again's Avatar
Distinguished Member with 3,730 posts.
 
Join Date: Sep 2003
Location: Atlanta, GA - Planet Earth
Experience: Brilliant When Sober
05-Nov-2009, 03:26 PM #4
I stepped through your code it is looks like it already disables the button once the image is inserted. Does it not work for you?

Regards,
Rollin
computerman29642's Avatar
Computer Specs
Distinguished Member with 2,640 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
05-Nov-2009, 03:42 PM #5
Rollin,

I apologize. Yes, it does work for me. I am working on multiple things at once, and I just read where you asked to see the code.
Zack Barresse's Avatar
Computer Specs
Distinguished Member with 4,511 posts.
 
Join Date: Jul 2004
Location: Oregon, United States
Experience: I'ma learnin'!
05-Nov-2009, 10:46 PM #6
World domination plans can be overwhelming at times. Multi-tasking is essential.
computerman29642's Avatar
Computer Specs
Distinguished Member with 2,640 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
06-Nov-2009, 10:13 AM #7
LOL...You're telling me. I am exhausted.

I guess the main question now is what do you think about the code. Is there a better way I could have handle some aspects of the code (or all the code)?
Zack Barresse's Avatar
Computer Specs
Distinguished Member with 4,511 posts.
 
Join Date: Jul 2004
Location: Oregon, United States
Experience: I'ma learnin'!
06-Nov-2009, 11:33 AM #8
Yeah, the code looks good. The only thing I'd look at maybe not using us the ActiveSheet, and that's just my severe aversion to it (as you know).
computerman29642's Avatar
Computer Specs
Distinguished Member with 2,640 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
06-Nov-2009, 12:23 PM #9
Yeah...I do not like using ActiveSheet either (after you have critic my codes before).

Did you get the code I sent to you through e-mail? That is actually the most current version of the code
computerman29642's Avatar
Computer Specs
Distinguished Member with 2,640 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
06-Nov-2009, 12:36 PM #10
Please see the updated Excel Workbook.

This is how the current code looks.
Attached Files
File Type: xls Book1_Revised.xls (33.0 KB, 11 views)
Zack Barresse's Avatar
Computer Specs
Distinguished Member with 4,511 posts.
 
Join Date: Jul 2004
Location: Oregon, United States
Experience: I'ma learnin'!
06-Nov-2009, 12:58 PM #11
I did get it via email. Saw this post and figured I'd post here. Trying to read VBA on my handheld is a bit precarious, it was the first time I'd done it. I got some funny looks while trying to scroll through it, I guess I looked intense. LOL!

But the code looks good. It's simple, elegant, does what you want, references are explicit, and it's backwards/forwards compatible. I think you have a winner.
computerman29642's Avatar
Computer Specs
Distinguished Member with 2,640 posts.
 
Join Date: Dec 2007
Location: HERE OR THERE?!?!?!
Experience: Always Learning!
06-Nov-2009, 01:16 PM #12
Thanks Zack.
Reply Bookmark and Share

Smart Search

Find your solution!



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.

Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -5. The time now is 02:57 PM.
Copyright © 1996 - 2009 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.
Powered by Cermak Technologies, Inc.