This is part of my loop code:
ActiveWorkbook.SaveAs StoreDir & "Store_" & ws.Name &
endoffilename & ".xls"
On Error GoTo ErrHandler:
pg.Sheets("Phone_Guidelines").Copy Before:=Workbooks("Store_" & ws.Name & endoffilename & ".xls").Sheets(1)
x = x + 1
mylog(x) = StoreDir & "Store_" & ws.Name & endoffilename & ".xls"
The SaveAs StoreDir location is a network path pathblabla all my folders are located
on the same server, and I wanted to write an error handling block to deal with the error number instead of displaying a
number to the user which would confuse.
What is the error number for when the SaveAs operation fails due to the
network drive being down ?
Also, is this the best way to write the error handling code ?
I guessed the
error number, where can I look them up ?
If Err.Number = 1004 Then ' network drive is down, so msg user and Exit routine
MsgBox ("It appears that the Store Network Drive is down, existing script. Please wait for the network drive
availability before executing this script.")