+ Reply to Thread
Results 1 to 7 of 7

Error with .Attachments.Add

  1. #1
    Registered User
    Join Date
    02-04-2021
    Location
    Israel
    MS-Off Ver
    365
    Posts
    9

    Error with .Attachments.Add

    Hello,

    This code that I'm using on a computer and its working PERFECTLY, but when I added this code to another computer, it stops adding the attachment to the email, what it does instead it displays the email without the attachment and it open the code showing me the line of ".Attachments.Add PdfFile" - indicating there is an error there, it's so weird how it works fine in a PC but it doesn't on another, any ideas?

    Please help me figure this out! here is the code:


    Please Login or Register  to view this content.
    Last edited by RyanMoran1990; 05-30-2021 at 03:09 PM.

  2. #2
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,165

    Re: Error with .Attachments.Add

    No Path Directory of PDF is specified here...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  3. #3
    Registered User
    Join Date
    02-04-2021
    Location
    Israel
    MS-Off Ver
    365
    Posts
    9

    Re: Error with .Attachments.Add

    how come it works in one PC and the other not? from what i understood, it uses the cache and then just deletes it, i dont want to save those files in my PC, i just want the code to send them and then just delete them.

    what its supposed to do is to create a PDF from the active sheet and then send it by email, in one PC its working perfectly, the other does not attach, the macro stops, displays the email without the attachment and marks the line ".Attachments.Add" in yellow.

    Please find sample attached
    Attached Files Attached Files
    Last edited by RyanMoran1990; 05-30-2021 at 01:30 PM.

  4. #4
    Registered User
    Join Date
    02-04-2021
    Location
    Israel
    MS-Off Ver
    365
    Posts
    9

    Re: Error with .Attachments.Add

    Please check reply

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,165

    Re: Error with .Attachments.Add

    Sometimes it saves to last used folder...Default folder
    Just specify Path..., the code deletes the file after anyway...This way no errors will occur...

    Try like such...
    Please Login or Register  to view this content.
    Last edited by sintek; 05-30-2021 at 02:39 PM.

  6. #6
    Registered User
    Join Date
    02-04-2021
    Location
    Israel
    MS-Off Ver
    365
    Posts
    9

    Re: Error with .Attachments.Add

    Worked perfectly! thanks! <3

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,165

    Re: Error with .Attachments.Add

    Glad I could assist...Happy Coding...

+ 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. [SOLVED] Error handling for macro that sends emails with different attachments
    By kylegascho in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 08-30-2019, 11:08 AM
  2. Error when adding attachments
    By sevanseriesta in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-13-2019, 04:14 PM
  3. Bad File Name error 52- Code to group email attachments
    By L_Misty in forum Outlook Formatting & Functions
    Replies: 1
    Last Post: 09-06-2017, 07:33 PM
  4. Send multiple emails with different attachments if attachments found
    By AnkitJain in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2015, 05:35 AM
  5. User form to add attachments and send the form and attachments via outlook
    By scorchio83 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-21-2013, 03:46 AM
  6. [SOLVED] Attachments
    By Bob Phillips in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-06-2005, 10:05 AM
  7. Attachments
    By meyer99 in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 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