+ Reply to Thread
Results 1 to 5 of 5

Attach File error

  1. #1
    Forum Contributor
    Join Date
    08-20-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    184

    Attach File error

    Hi,

    Using new Office and suddenly, I have a new error on an old Macro. It attaches an attachment when pressing a commandbutton. below is the code.

    Please Login or Register  to view this content.
    I get an 'Run Time Error 1004 - Cannot insert object" error.

    What do I need to add / change to remove this error?

    Many thanks in advance.

  2. #2
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Attach File error

    .
    .
    This is what I commented out from the macro ... and it functions well here :

    Please Login or Register  to view this content.

  3. #3
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Attach File error

    .
    .
    I've experimented with more of the code and have identified the problem (as the code is presently written)
    centers on the CommandButton portion.

    Specifically this portion with the commented out lines:

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    08-20-2012
    Location
    London,England
    MS-Off Ver
    Excel 2010
    Posts
    184

    Re: Attach File error

    Thanks for this. it worked now.

  5. #5
    Forum Expert Logit's Avatar
    Join Date
    12-23-2012
    Location
    North Carolina
    MS-Off Ver
    Excel 2019 Professional Plus - 2007 Enterprise
    Posts
    7,014

    Re: Attach File error

    You are welcome. Glad you have it sorted out.

+ 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. Browse for a file edit the file then attach it to an email
    By Bobbbo in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-06-2016, 11:50 PM
  2. I need VBA to save file and attach file to email based on conditional statements
    By jcrowe31 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-01-2014, 09:41 AM
  3. [SOLVED] Unable to attach a file error code 407
    By moppyau in forum Suggestions for Improvement
    Replies: 2
    Last Post: 04-30-2013, 05:36 AM
  4. Not able to attach a file
    By massive_set in forum Suggestions for Improvement
    Replies: 7
    Last Post: 01-15-2013, 01:52 AM
  5. [SOLVED] Attach file got error
    By st3vi3 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-23-2012, 03:55 AM
  6. Replies: 2
    Last Post: 02-11-2010, 02:37 PM
  7. Attach File as Zip
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-06-2007, 03:32 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