+ Reply to Thread
Results 1 to 15 of 15

export to pdf not attaching to the email

  1. #1
    Registered User
    Join Date
    01-08-2014
    Location
    wigan
    MS-Off Ver
    2007
    Posts
    78

    export to pdf not attaching to the email

    Hello, please can someone identify the bug in the following code. it is supposed to export a selection of the worbook to a pdf in the workbook folder, and attach the file to an email, generating to/cc/subject/email dialogue. which it does.

    it is also supposed to attach the file to the email, which is doesn't.

    Any advise help or suggestions greatly appreciated.

    thanks,

    Please Login or Register  to view this content.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: export to pdf not attaching to the email

    Shouldn't you be passing sFilename instead of Filename to the RDB_Mail_PDF_Outlook2 function?
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    01-08-2014
    Location
    wigan
    MS-Off Ver
    2007
    Posts
    78

    Re: export to pdf not attaching to the email

    hi, no - this doesn't work either.

    thanks,

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: export to pdf not attaching to the email

    What exactly did you change?

    Have you tried stepping through the code with F8?

    Have you checked where the PDF is being saved to?
    Last edited by Norie; 01-29-2014 at 09:30 AM.

  5. #5
    Registered User
    Join Date
    01-08-2014
    Location
    wigan
    MS-Off Ver
    2007
    Posts
    78

    Re: export to pdf not attaching to the email

    hello, i changed 'filename's to 'sfilename'. other than that I don't really know what to check for.

    the pdf is being saved to the location the workbook is saved.

    I have tried to step through it but it does just that, it steps through to the end where it generates the email but without the attachment.

    thanks.

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: export to pdf not attaching to the email

    Are you sure that's where the PDF is saved to?

    You don't actually specify the path anywhere here.
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-08-2014
    Location
    wigan
    MS-Off Ver
    2007
    Posts
    78

    Re: export to pdf not attaching to the email

    that's where it is going - does it not go there by default?

    thanks,
    dan.

  8. #8
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: export to pdf not attaching to the email

    Dan

    It goes to whatever directory is active at the time, which could be the same as the workbook.

    However you aren't including the path when passing the filename to the function either, so that could be a problem.

  9. #9
    Registered User
    Join Date
    01-08-2014
    Location
    wigan
    MS-Off Ver
    2007
    Posts
    78

    Re: export to pdf not attaching to the email

    oh right, i'm new to this so am prone to errors.

    How do I specify the output to be the location where the workbook is saved? I will give that a try.

  10. #10
    Registered User
    Join Date
    01-08-2014
    Location
    wigan
    MS-Off Ver
    2007
    Posts
    78

    Re: export to pdf not attaching to the email

    any ideas? thanks agian,

  11. #11
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: export to pdf not attaching to the email

    Try this.
    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    01-08-2014
    Location
    wigan
    MS-Off Ver
    2007
    Posts
    78

    Re: export to pdf not attaching to the email

    no this still doesn't work... is the file location not something to do with this:

    Please Login or Register  to view this content.
    which then incorporates here:

    Please Login or Register  to view this content.
    thanks.

  13. #13
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: export to pdf not attaching to the email

    That's what I added, it wasn't in the original code.

  14. #14
    Registered User
    Join Date
    01-08-2014
    Location
    wigan
    MS-Off Ver
    2007
    Posts
    78

    Re: export to pdf not attaching to the email

    jesus, sorry mate. is it because it's not included in the attachments bit:

    Please Login or Register  to view this content.

  15. #15
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: export to pdf not attaching to the email

    sFilename doesn't belong there, the filename of the attachment is passed to the function as the argument FileName.
    Please Login or Register  to view this content.
    Any chance you could upload a sample workbook?

    Then I could test the code, which I've not been able to do because I've not been able to recreate the setup you have.

+ 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] Attaching Picture to Email
    By Janie in forum Outlook Formatting & Functions
    Replies: 4
    Last Post: 07-30-2013, 04:23 PM
  2. [SOLVED] Attaching PDFs in a folder to an email.
    By yeahyeahyeah in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-02-2012, 06:02 PM
  3. Attaching files to an email
    By damage in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-12-2011, 01:14 PM
  4. Attaching One Worksheet to Email
    By KeshnerH in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-26-2005, 04:06 PM
  5. [SOLVED] attaching tabs to email
    By please help in forum Excel General
    Replies: 3
    Last Post: 01-19-2005, 04:06 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