LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 101
Default Checking for Errors

I am sorry to admit that I have done very little with error checking in my
macros, so I need some help in structuring here.

Our network drives need cleaning up really badly, and I have created a macro
that reads through the directory and creates a worksheet of all folders,
subfolders, subsubfolders, etc. I use nested For Each...Next loops to pull
out the data.

I have access to most everything on the network, but a couple of the big
dogs have their folders secured, and when I hit one of those, I get an access
denied error when I attempt to go into the folder to pull file and subfolder
names. The error occurs on the 'For Each' statement. In front of the 'For
Each' statement I put an 'On Error Resume Next' statement, but the statement
for 'resuming next' is the 'Next' for the 'For Each', and when it tries to
resume there, it says 'For loop not initialized', which of course is logical
since it never got into the loop.

Could I get some quick idea on how to branch somewhere, check the error
number, reset the error checking, and return to the statement after the
'Next' statement on that error? I would certainly appreciate it.

--
Bill @ UAMS
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I remove multiple 'errors' in Excel error checking, at the same time??? [email protected] Excel Discussion (Misc queries) 2 May 11th 23 11:42 AM
Macro's checking for errors Brad Excel Programming 2 February 20th 07 08:36 PM
Checking excel for errors/inconsistencies markx Excel Worksheet Functions 1 February 23rd 05 03:13 PM
checking errors in the formulas cawemann[_2_] Excel Programming 2 November 28th 03 03:03 PM
checking for errors in combobox's Bob C[_2_] Excel Programming 1 September 4th 03 09:03 PM


All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"