+ Reply to Thread
Results 1 to 4 of 4

Manipulating embedded objects

  1. #1
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Manipulating embedded objects

    I've cobbled some code together to embed a file to the next empty cell in a column on a worksheet, as follows.


    What I can't figure out is how to change the size of that object to make it more manageable within the table. I'm assuming that I would have to rename the object to identify it & therefore be able to locate it. At the moment each embedded file follows standard naming convention, i.e. , Object 1, 2........


    It is was to have to be renamed, I would like the name to reflect the adjacent cell contents, cell A2 data, cell B2 data, cell C2 embedded file.


    Please Login or Register  to view this content.
    Thank you

  2. #2
    Forum Expert
    Join Date
    10-02-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    1,222

    Re: Manipulating embedded objects

    It looks to me glancing over your snippet and without a sample file to test that you are looping cells and if the contents length = 0 then selecting the cell. You then set the value of the cell to "Y". It then appears to me that your adding the object based on the implied selected cell?

    First, the cell.select is not a good way to go about this. Most objects in Excel/VBA do not need to be selected to act upon them. Doing so is both slower and more prone to issues than simply acting upon the object.

    IE:
    Please Login or Register  to view this content.
    No need for select in the psuedo code above. Same result, 1 less line of code and no need to change selections.

    That however then leaves you needing to explicitly place the object as desired which I am not sure of how to do off the top of my head.

    However, it does lead us to the answer to your question in a general sense.

    If you drop selection as the method for how you manipulate things, then your object insertion would likely take place within your loop (if inserting multiple files). Either way, your best bet is to use a variable for the object for either the single object you will insert or each object you insert within the loop. By assigning/setting it to a variable you can then act upon it using the variable easily.

    If you post a sample I could take a stab at it.
    Ways to get help: Post clear questions, explain your overall goal, supply as much background as possible, respond to questions asked of you by those trying to help and post sample(s) files.

    "I am here to help, not do it for people" -Me

  3. #3
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Manipulating embedded objects

    File added.

    Yes, you've got what I'm trying to do. As you can see from the file with the code above I'm trying to add the corresponding external file to Column C in the "Table1" sheet which will accompany the table entries for that file.


    Hope that makes it clearer.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    05-08-2009
    Location
    england
    MS-Off Ver
    Excel 2007
    Posts
    223

    Re: Manipulating embedded objects

    I've found a workaround.

+ 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. Help Needed With Manipulating Embedded Chart
    By PosseJohn in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-06-2015, 05:34 AM
  2. Macros and Embedded Objects
    By DragonzMagik in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2009, 02:48 PM
  3. Embedded Objects on Userform
    By vincentus84 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-09-2009, 07:32 AM
  4. Manipulating Excel Worksheet Embedded into Document
    By jasoncw in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 04-09-2008, 02:43 PM
  5. Embedded objects
    By Mike25 in forum Excel General
    Replies: 1
    Last Post: 03-23-2006, 10:10 AM
  6. Embedded Objects
    By Lightfoot in forum Excel General
    Replies: 0
    Last Post: 12-30-2005, 10:25 AM
  7. Copying Embedded Objects
    By jmoseley in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-17-2005, 03:47 PM

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