+ Reply to Thread
Results 1 to 4 of 4

Automatic Email Macro

  1. #1
    Registered User
    Join Date
    10-14-2009
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel 2003
    Posts
    10

    Automatic Email Macro

    Hello,

    I am using the below code to automatically email excel reports via Lotus Notes and it works great. My question is that at times I will run this macro and there will be no report to send that day (an error obviously will occur as the macro cant locate the file). Is there an IF, THEN statement I can include in the code so if the file does not exist the macro should simply end? Any help would be appreciated. Thanks!

    Please Login or Register  to view this content.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Automatic Email Macro

    Hi,

    Try putting an 'Else' in the bit of code which attaches the file. e.g

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    10-14-2009
    Location
    Milwaukee, WI
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Automatic Email Macro

    Hello Richard,

    I did as you said and it did not work. I get the below error message:

    Run-time error '7225':

    File G:\Share\Financial and Quality Control and Training\Reporting\Transfer Agency\Data Information\Processing Team 1.xls not found

    Any additional thoughts?

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Automatic Email Macro

    Hi,

    Sorry, my fault. I missed the point that the attachment is actually being predefined and that filename therefore always exists as a string but not necessarily as a file.

    Try instead

    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)

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