+ Reply to Thread
Results 1 to 6 of 6

VBA Code to eliminate embedded files when open excel workbook.

  1. #1
    Registered User
    Join Date
    12-12-2013
    Location
    Sudbury
    MS-Off Ver
    Excel 2010
    Posts
    66

    VBA Code to eliminate embedded files when open excel workbook.

    Hello Folks,
    I created a project form and I need to embed docs to support data entered in the form. Currently I can fill the form and embed files and when click "Save & Clear" Button, It clears the form and save all other data along with embedded files but it doesn't clear (or eliminate embedded files).

    It will be great if someone help me and write a code to eliminate embedded files whenever I open my excel workbook.

    I attached a sample file....
    Attached Files Attached Files
    Last edited by ray.kanata; 03-09-2015 at 09:40 AM.

  2. #2
    Registered User
    Join Date
    09-27-2011
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    86

    Re: VBA Code to eliminate embedded files when open excel workbook.

    Hi Ray

    You have delete the embedded objects as clearing the content won't help.
    Use the below updated code for you sub route NextInvoice

    Please Login or Register  to view this content.
    regards,
    lokicl

  3. #3
    Registered User
    Join Date
    12-12-2013
    Location
    Sudbury
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: VBA Code to eliminate embedded files when open excel workbook.

    Great Thanks lokicl!

    It solved my problem

  4. #4
    Registered User
    Join Date
    12-12-2013
    Location
    Sudbury
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: VBA Code to eliminate embedded files when open excel workbook.

    Hi lokicl!

    Can you please explain each line of the code above?

    Thanks

  5. #5
    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: VBA Code to eliminate embedded files when open excel workbook.

    Hello Ray,

    This code does the same thing. I use OLEObjects instead of Shapes because it makes what is happening easier to understand and it makes all properties and methods available to you.

    Since you are dealing with embedded objects, these objects belong to the OLEObject class. OLE stands for Object Linking and Embedding.

    Please Login or Register  to view this content.
    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!)

  6. #6
    Registered User
    Join Date
    12-12-2013
    Location
    Sudbury
    MS-Off Ver
    Excel 2010
    Posts
    66

    Re: VBA Code to eliminate embedded files when open excel workbook.

    Thanks Leith,
    I tried to modify my code below based on your code above but didn't work.
    Please let me know how Can I utilize your code in my code?

    Thanks

    Please Login or Register  to view this content.

+ 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. macro to open files and copy specific sheet into new workbook (have open files part)
    By dangerdavedsp in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2015, 02:23 PM
  2. Open an Embedded Excel workbook in Excel
    By mmctague in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-25-2012, 02:13 PM
  3. Using excel vba to open, save as, and close embedded pdf files
    By mcledavid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-22-2009, 05:22 PM
  4. exce; macro to open, save embedded pdf, word, excel, ppt files to a folder
    By mcledavid in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-16-2009, 05:17 PM
  5. Replies: 0
    Last Post: 09-16-2009, 05:11 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