+ Reply to Thread
Results 1 to 4 of 4

(Email worksheet) Show MsgBox when failing to save temp file

  1. #1
    Registered User
    Join Date
    02-05-2013
    Location
    Cz
    MS-Off Ver
    Excel 2003
    Posts
    2

    (Email worksheet) Show MsgBox when failing to save temp file

    Hi,

    I have created an excel sheet with en email button that send the sheet as an attachment. For this the sheet is saved temporary on C:\ and then deleted once the email has been sent.

    For my work laptop I am not able to access C:\ as we have network disks, thus I am not able to use this macro on my latop. If a user of this sheet has the same issue, not being able to save to C:\ I would like a MsgBox to appear notifying them of the error.

    However, I am not able to figure out how to do this.

    Is anyone able to help?

    If anything is unclear just let me know (see below for code)

    Thanks,

    Timmy

    Please Login or Register  to view this content.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: (Email worksheet) Show MsgBox when failing to save temp file

    Switch to using something everyone has access to.... their own Desktop. This first snippet shows how to capture the location of the user's Desktop, then the next snippets show it being used to delete and write files:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 03-29-2013 at 10:41 AM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-05-2013
    Location
    Cz
    MS-Off Ver
    Excel 2003
    Posts
    2

    Re: (Email worksheet) Show MsgBox when failing to save temp file

    Thanks for a quick reply. This really helps a lot, am a beginner when it comes to vba.

    Cheers,
    Timmy

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: (Email worksheet) Show MsgBox when failing to save temp file

    If that takes care of your original query, please select Thread Tools from the links above and mark this thread as SOLVED. Thanks.

+ 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