terrypin Posted May 11, 2013 Report Share Posted May 11, 2013 I don't use the On Error routine very much, so perhaps the following has an obvious answer. I have a macro that first opens a folder and thought I'd better include a check for the folder's existence. But it never seems to get executed, even when the folder plainly doesn't exist as in this simplified example: Open Folder to "Q:\xyz\abc" // On Error set to 'The path does not exist', 'Handle error'.On Error Catch Error: The path does not exist Text Box Display: // Display "The folder doesn't exist." End Catch ErrorEnd Error Also, if I set the On Error option to Prompt for action in the Open Folder command, no prompting occurs. In summary, if a non-existent folder is specified in the Open Folder command, the macro just sails through and ignores it. --Terry, East Grinstead, UK TestOpenFolderPuzzle.mex Quote Link to comment Share on other sites More sharing options...
paul Posted May 12, 2013 Report Share Posted May 12, 2013 Agreed - no error condition is triggered. Therefore it follows that the Prompt for Action subcommand won't work. Quote Link to comment Share on other sites More sharing options...
terrypin Posted May 12, 2013 Author Report Share Posted May 12, 2013 Thanks Paul. Should an error condition be triggered (implying a bug)? --Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
paul Posted May 12, 2013 Report Share Posted May 12, 2013 Well, given that there exists an error for a missing folder, it seems to me that it should generate an error. Report it anyway. Quote Link to comment Share on other sites More sharing options...
Cory Posted May 16, 2013 Report Share Posted May 16, 2013 I only ever use exception handlers as a last resort. In this case I would use the "If Folder Exists" command instead. Quote Link to comment Share on other sites More sharing options...
acantor Posted May 20, 2013 Report Share Posted May 20, 2013 Please report the problem. I have experimented with error handling in MEP, but not found the feature particularly reliable, especially the "Halt macro" option. "Prompt for action" works better for me. I will also start reporting error handling problems to Insight. Quote Link to comment Share on other sites More sharing options...
terrypin Posted May 20, 2013 Author Report Share Posted May 20, 2013 Alan, I reported it on 12 th May. Terry, East Grinstead, UK Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.