+ Reply to Thread
Results 1 to 5 of 5

Excel 2010 file with VBA save and send code works-but file can't be found.

  1. #1
    Registered User
    Join Date
    02-07-2013
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2010
    Posts
    3

    Excel 2010 file with VBA save and send code works-but file can't be found.

    I have created a form at work with "save and send" functionality that works, except for if you try and find the file you saved to your computer- it can't be found. Specifically, I'm searching in Windows 7 using the search bar above the "start" icon- it will actually display the file you just saved- but when you click on it- you will get the error "Windows is searching..."....and then later you will get a prompt saying that the shortcut has been changed or moved and no longer works. I'm using a variety of code that I have picked up from different help websites and everything works otherwise.
    Any suggestions- here is code:

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 03-13-2013 at 09:27 AM. Reason: Corrected thread title to topic only, added CODE tags as per forum rules. Please STOP and read the Forum Rules (link above in menu bar)

  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: Excel 2010 file with VBA save and send code works-but file can't be found.

    Reading your own macro, one quickly sees:
    Please Login or Register  to view this content.
    So your macro deletes the file after it has been mailed. Right? It's your macro so it's doing what you've allowed.


    Now, look for the line of code that deletes your file and remove that, then it won't be deleted. That's pretty easy to spot, too, since it's commented.


    Also, since you want to KEEP the file, perhaps you want to save it in a more exact location instead of letting the macro hide it in a TEMP folder. So maybe change this to something you want:
    Please Login or Register  to view this content.
    Like:
    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 03-13-2013 at 09:33 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-07-2013
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel 2010 file with VBA save and send code works-but file can't be found.

    Thanks JB-
    I tried deleting various lines below- first just the "Kill...." line. It didn't work.
    Then I deleted everythng below- still didn't work.
    It continues to save, then it can be found during search, but then when you click on it- can't be found.

    Allow me to through in a variable here- because of the nature of this process, it has been a blessing that the file does not save. The email's go to a contractor. If there is an issue with the contractor regarding this issue- we would rather have the user find the original email sent and forward it back to the contractor with their inquiry. Additionally- we have made 5 changes to the form in 3 months. We don't want users going back to an old form they have saved - we want them to always go to the web for the newest version.
    Any other ideas?

    Please Login or Register  to view this content.
    Last edited by carlton.clay; 03-14-2013 at 02:29 PM. Reason: Tagging the code

  4. #4
    Registered User
    Join Date
    02-07-2013
    Location
    Cleveland, OH
    MS-Off Ver
    Excel 2010
    Posts
    3

    Re: Excel 2010 file with VBA save and send code works-but file can't be found.

    Looking back through my notes- I see I may have looked at this article to get my code used. I see something now that I didn't see then- they indicate that the file will be removed or erased from the hard disk. Not sure how I can change that- i guess that is the nature of my question:

    http://msdn.microsoft.com/en-us/libr...ffice.11).aspx

    What would be really cool is if I could let the user save it as part of the save and send VBA--- but attached to the file name would be a string like "....NOT TO BE USED TO CREATE NEW REQ...."

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

    Re: Excel 2010 file with VBA save and send code works-but file can't be found.

    Please read my edits to your post #1. Then read the Forum Rules, then edit post #3.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

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