+ Reply to Thread
Results 1 to 15 of 15

Hide command button behind pic

  1. #1
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Cool Hide command button behind pic

    I have a command button that is within a cell that when selected it insert a picture, the problem I have is when picture is in selected cell (same as command button) I can still view the command button from behind. I set the picture to “view from front” and Command button to “view from rear” but it doesn’t solve anything. I also have the command button checked to not print. Any ideas………………..

  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: Hide command button behind pic

    Hello ABabeNChrist,

    Do you want to hide the button, make it invisible, or just keep the button behind the picture?
    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
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Cool Re: Hide command button behind pic

    Quote Originally Posted by Leith Ross View Post
    Hello ABabeNChrist,

    Do you want to hide the button, make it invisible, or just keep the button behind the picture?
    Hi Lieth Ross
    I want the command button to be visible to use, but yet not printable, and once picture is selected the command button goes behind picture, and not visible view. I don’t want command button to be removed, just in case wrong selection was made, that way picture could be deleted and then reuse command button once more to make correct selection. Here is the code I use to inset and size picture.
    And yes “just keep it behind picture”
    And by the way I’m using Excel 2007
    Please Login or Register  to view this content.

  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: Hide command button behind pic

    Hello ABabeNChrist,

    Is the picture going into cell "B1"? Is the CommandButton located in cell B1 also?

  5. #5
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Hide command button behind pic

    Hi Leith Ross
    Is the picture going into cell "B1
    Yes
    Is the CommandButton located in cell B1
    Yes

  6. #6
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Hide command button behind pic

    Any suggestion how I may achieve this.....

  7. #7
    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: Hide command button behind pic

    Hello ABabeNChrist,

    Here is the amended version of the macro...
    Please Login or Register  to view this content.
    Last edited by Leith Ross; 01-15-2010 at 09:53 PM. Reason: Added ZOrder command

  8. #8
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Hide command button behind pic

    Hi Leith Ross
    i just tried the code and I got an error on this line

    .ZOrder = msoBringForward

    Compile error
    Argument not optional

    I am using Excel 2007 if that make any difference

  9. #9
    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: Hide command button behind pic

    Hello ABabeNChrist,

    Sorry about that. Just force of habit to add an equal sign. The line should read...
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Hide command button behind pic

    OK the picture was inserted in correct cell and the height was correct but the width was too narrow.
    I have a JPG that show picture to the left using new code. even when I try to expand the picture it still does not hide command button (picture to the right).
    and I also set the .PrintObject = False to True
    Attached Images Attached Images

  11. #11
    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: Hide command button behind pic

    Hello ABabeNChrist,

    Can you post a copy of the workbook so I can review what is happening in the code?

  12. #12
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Hide command button behind pic

    I found why picture was so narrow, I am using merged cells. So I added the range of merged cell and picture sized up correctly, everything is great except I still see the button. See attached picture.
    Set MyRange = Range("C4:J4")
    Attached Images Attached Images

  13. #13
    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: Hide command button behind pic

    Hello ABabeNChrist,

    I do not know why the button is still on top. The code works fine in Excel 2003. The picture covers the button and I can select the picture, delete it, and the button is there under the picture.I am at a disadvantage because I do not have Excel 2007. There my be a setting that is missing for 2007 that changes the order of the layers (ZOrder). If you post a copy of the workbook it would help confirm or disprove the hypothesis.

  14. #14
    Forum Contributor
    Join Date
    09-07-2009
    Location
    Hemet, CA
    MS-Off Ver
    Office 2007 Professional
    Posts
    111

    Re: Hide command button behind pic

    Quote Originally Posted by Leith Ross View Post
    Hello ABabeNChrist,

    I do not know why the button is still on top. The code works fine in Excel 2003. The picture covers the button and I can select the picture, delete it, and the button is there under the picture.I am at a disadvantage because I do not have Excel 2007. There my be a setting that is missing for 2007 that changes the order of the layers (ZOrder). If you post a copy of the workbook it would help confirm or disprove the hypothesis.
    Leith Ross
    I just find this thread in regards to .ZOrder msoBringForward that is prabably the problem
    http://social.msdn.microsoft.com/For...f-b57b01fc228e

  15. #15
    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: Hide command button behind pic

    Hello ABabeNChrist,

    I am going out for awhile. I will pick this up when I return. Thanks for the informative article.

+ 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