+ Reply to Thread
Results 1 to 2 of 2

Attach a file that is open to an email

  1. #1
    Forum Contributor
    Join Date
    04-05-2010
    Location
    Lakewood, IL
    MS-Off Ver
    Excel 2016
    Posts
    384

    Attach a file that is open to an email

    I have a macro that has the user browse for a file which I name "ManualForm" I do some edits to that file then I want to save it and email it as an attachment to an email. Here is the browsing code:
    Please Login or Register  to view this content.
    Then after my edits I use this code to attach it as an email but it fails, where "Cover" is another open workbook that contain information on where to: and cc: send the email.
    Please Login or Register  to view this content.
    Any idea why it will not attach the file?

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Attach a file that is open to an email

    The command .Attachments.Add is expecting a Path and File Name as string for an input argument. The function ManualForm is returning an Excel workbook object. They are two different things. One's an object, the other is a string. Does that make sense, or do you need more?

    The quick fix it to change this...
    Please Login or Register  to view this content.
    To something like this...
    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 10-06-2016 at 11:23 PM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

+ 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] VBA Using Excel to Attach file to Email
    By knighty2002uk in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-22-2014, 10:27 AM
  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. Macros to open new outlook email and attach the excel sheet
    By nageshpolu in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-23-2014, 02:26 PM
  4. Launch email and attach open workbook to email?
    By mlefkowitz in forum Excel General
    Replies: 0
    Last Post: 09-11-2012, 02:01 PM
  5. Email workbook AND attach a separate file to the email
    By sgreni in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-15-2009, 06:48 PM
  6. App to open user's email client, attach file
    By ern2ern in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 04-23-2008, 08:57 AM
  7. Attach all Open Workbooks to email as separate files?
    By nbaj2k in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-03-2006, 09:30 AM

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