Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 04-03-2020, 04:50 PM
ChrisOK ChrisOK is offline Error Handler If User Does Not Want to Overwrite File Windows 10 Error Handler If User Does Not Want to Overwrite File Office 2019
Advanced Beginner
Error Handler If User Does Not Want to Overwrite File
 
Join Date: Sep 2016
Posts: 54
ChrisOK is on a distinguished road
Question Error Handling

Ok Bob, finally got a chance to test it tonight - and appears I still have something wrong.. This error handling is new.. but likely important to start incorporating..


I put the On Error part at the very top (just below the name of the Sub) as directed... then added the ErrHandle: piece below the 'SAVE RESULTS FILE' section


Getting a compile error: Else without If (screenshot attached)



If the user chooses "Yes" then I'd like it to continue w/ scripts
If the user chooses "No" or "Cancel" (which is giving the 1004 error) l'd like the script to just end w/ a MsgBox "Exiting Sub"
Attached Images
File Type: gif error-handling.GIF (16.5 KB, 13 views)
Reply With Quote
 

Tags
error handling, rename file



Similar Threads
Thread Thread Starter Forum Replies Last Post
MS Word Error: This file is in use by another application or user conky Word 4 02-26-2019 09:21 AM
How can I get Outlook from one user to another w/o a .pst file (primary user on computer is corrupt) Tenmakk Outlook 0 03-01-2015 12:49 PM
Error Handler If User Does Not Want to Overwrite File How to Control Worksheet Event Handler in Module? tinfanide Excel Programming 2 10-19-2014 09:46 AM
Error Handler If User Does Not Want to Overwrite File Stop macro if no file is selected in dialog box (when user presses cancel instead of selecting file) spencerw.smith Word VBA 2 08-12-2014 07:56 AM
Word does not ask do i want to overwrite a file on saving a file sam2149 Word 2 03-24-2014 04:18 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:32 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft