+ Reply to Thread
Results 1 to 2 of 2

VBA code to set PICTURE shape attribute other than .name

  1. #1
    Forum Contributor
    Join Date
    09-20-2014
    Location
    India
    MS-Off Ver
    2013
    Posts
    275

    Question VBA code to set PICTURE shape attribute other than .name

    Dear all,
    I am facing an interesting issue.
    Let me explain how this issue came.
    I have a workbook with some 20 sheets with around 50 check points each, to be validated over an image and i have a macro to insert 'n' number images in 'm'(=20) of sheets in sequence to carryout this self check (if n<20, macro deletes rest of the sheets.)

    I have developed this macro in such a way, that if any image is inserted using this macro, all the 50 check points will reset (Just to make sure everyone validates without any shortcuts).
    As a loop hole, user started using 'Snipping Tool' to key-in image manually where Check points are already validated.

    So to avoid this, i modified this macro to re-name(Selection.Name = "ABC") each image with specific name and initiated a validation on "Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)" to make sure each sheet has a image keyed-in using macro (Just FYI, if snipped tool is used, picture name will be obviously different. If my validation macro didnt find this picture name (Sh.Pictures(1).Name <> "ABC"), it resets all the fields again..:D)

    I hope i clear till now with my entire process.

    NOW here is the main problem
    There is one more loop identified recently. If user right clicks on any image file, on the menu he gets a option of "Change Picture". If he replaces existing image using this method, to my bad luck, picture name remain the same (="ABC")..

    What i am looking for..?

    I need such an attribute for picture file (similar to '.Name'), that i can change while inserting while inserting images using macro, but must NOT CHANGE if image is replaced using "Change Picture" option from right click menu..?

    Please suggest.
    PS: Each sheet has only one picture file but has many rectangle shapes as check points. So Shapes attribute may not applicable for Pictures.
    Last edited by mchilapur; 08-13-2015 at 09:25 AM.

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,607

    Re: VBA code to set PICTURE shape attribute other than .name

    My simple suggestion is not base only on pictures, but also use for instance a sheet with attribute very hidden
    Please Login or Register  to view this content.
    and note there which tasks were completed. if at any point a number stored there does not agree with your "marker pistures" raise an alarm. Of course code has to be password protected etc.
    Best Regards,

    Kaper

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Automatically bringing a Shape into a Cell Using Shape Code
    By dineshtendulkar in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 12-16-2016, 02:25 PM
  2. Changing a Picture's Shape
    By Shleifer in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-12-2014, 07:25 PM
  3. Changing a Picture's Shape
    By Shleifer in forum Hello..Introduce yourself
    Replies: 1
    Last Post: 09-10-2014, 02:18 PM
  4. [SOLVED] deleting picture (shape)
    By TimlmiT in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-30-2014, 10:13 AM
  5. need code to change shape fill to a picture when another cell = 1
    By Muzza86 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 05-16-2014, 05:57 AM
  6. Adding Picture to Shape
    By ando185 in forum Excel General
    Replies: 0
    Last Post: 06-25-2013, 03:27 PM
  7. Shape/picture name in a worksheet
    By neta in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-29-2006, 11:00 AM

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