+ Reply to Thread
Results 1 to 6 of 6

Old Oleobject naming problem after 2007 conversion

  1. #1
    Registered User
    Join Date
    06-08-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    9

    Old Oleobject naming problem after 2007 conversion

    Hi,
    I have a Excel workbook that has been created long time ago (probably Excel 97) that have several checkbox in it lost the name after converting to XLSM. Basically, I am not able to find the real name of the object thru oleobjects, but only able to see it under activesheet property. If I rename it under property then the oleobjects will be constant with actual name. I guess it must be some obsolete format left over, but I don't know what it is. Does anyone know why it happens?

    I am trying to demonstrate what's going on using following codes:
    ?typename(activesheet.chkmr)
    CheckBox
    ?typename(activesheet.oleobjects(1).object)
    CheckBox
    ?activesheet.chkmr.top
    65.25
    ?activesheet.oleobjects(1).top
    65.25
    ?activesheet.chkmr.name
    chkMR
    ?activesheet.oleobjects(1).name
    CheckBox1
    Thanks for any help.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Old Oleobject naming problem after 2007 conversion

    Can you post example workbook. Just need to see a single control that will not reference correctly.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-08-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Old Oleobject naming problem after 2007 conversion

    Thanks for you help.
    I attached the xls file that has only two checkboxes. The test function in workbook shows that oleobjects can only see the name "Checkbox1" instead of "chkMR".
    Attached Files Attached Files

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Old Oleobject naming problem after 2007 conversion

    I can see what you mean.

    Although when I did the conversion I did get a warning message telling me there would be a problem.
    ---------------------------
    Microsoft Office Excel
    ---------------------------
    This workbook contains one or more of the following features that are not supported by the selected file format:
    •Excel 5.0/95 Menu Editor Customizations
    To save the workbook without these features, click OK.
    To keep using these features, click Cancel, and then select a file format that supports the features.
    ---------------------------
    OK Cancel
    ---------------------------
    Looks like you will have to rename those items after the conversion.

    I did not get the problem with a xl2003 conversion so can only assume it's a problem with xl97.

  5. #5
    Registered User
    Join Date
    06-08-2009
    Location
    Canada
    MS-Off Ver
    Excel 2003
    Posts
    9

    Re: Old Oleobject naming problem after 2007 conversion

    Thanks for your help.
    Is there anyway I can get to the name "chkMR" in VB code? I understand that I need to fix the name one by one but it would be good if I can detect it in advance by compare the name in oleobjects and actual name. I tried shapes as well and they return "checkbox1" instead of "chkMR".

    Is there anyway to refer to activesheet properties by let say index ID?

    Appreciated for your help.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,436

    Re: Old Oleobject naming problem after 2007 conversion

    If you still have xl97 you could write some code to details of each object.

    You could try using the topleftcell and bottomrightcell to identify objects.
    Also any text/caption or cell referencing.

    The in latest version you would need to go through the objects and try matching as much information as possible before giving the object a Name.

+ 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