Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have a procedure, shown below (in part), where I want to jump to another
part of the code when the Directory is invalid. ie I want to be able to run the code on 3 different computers without having to amend the code each time. Maybe there's a better way to do this, but I would have thought that what I have done should work! ie in the part of the code that's headed 'work, if there is no such dir, then the code jumps to the line OFFICE: without a hitch, BUT even though there is no valid dir in the OFFICE: part of the code, I get a run-time error 76 "Path not Found" at the line "ChDir dir", and it doesn't jump to the next part of the code (ie HOME:). Why doesn't the On Error command work at that point? If there is a better way to do this please advise. Rob Dim drive As String Dim dir As String 'work WORK: On Error GoTo OFFICE dir = "H:\SupporterStats Construction\" drive = "H" ChDir dir GoTo Proceed 'Office OFFICE: On Error GoTo HOME dir = "K:\2007\common\Supporter Stats\" drive = "K" ChDir dir GoTo Proceed 'home HOME: dir = "C:\Documents and Settings\USER\My Documents\Fola\UnderConstruction\" drive = "C" ChDir dir Proceed: |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Don't think it's possible, but I thought I would ask. | Excel Worksheet Functions | |||
Simple Formula (I thought) | Excel Worksheet Functions | |||
I THOUGHT I knew what I was doing | Charts and Charting in Excel | |||
This is A LOT harder than I thought it would be | Excel Discussion (Misc queries) | |||
On second thought ... | New Users to Excel |