Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I need to code for the possibility that a path was removed from th system. If the code is looking for a path that not longer exists, how to I cod to move past the error and open the dialog? Code ------------------- On Error Resume Next Set wb = Workbooks(cwb) On Error GoTo 0 If wb Is Nothing Then If Not GetSetting("PJL", "Startup", "wbPath") = "" Then Sheets("Admin").Range("CalPath") = GetSetting("PJL", "Startup", "wbPath") ChDrive Sheets("Admin").Range("CalPath") ChDir Sheets("Admin").Range("CalPath") End If fileName = Application.GetOpenFilename("Excel Files (*.xls),*.xls)", , _ "Please choose a Production Schedule workbook to open") cwb = ParsePath(fileName, "FILE_ONLY") wbPath = ParsePath(fileName, "PATH_ONLY") Sheets("Admin").Range("CalPath") = wbPath SaveSetting appname:="PJL", section:="Startup", _ key:="wbPath", setting:=wbPath Sheets("Admin").Range("CalName") = cwb Set wb = Workbooks.Open(wbPath & cwb) End If ------------------- -- scain200 ----------------------------------------------------------------------- scain2004's Profile: http://www.excelforum.com/member.php...nfo&userid=705 View this thread: http://www.excelforum.com/showthread.php?threadid=27537 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
chdir not accepting string for path | Excel Programming | |||
Automation Error, Unknown Error. Error value - 440 | Excel Programming | |||
Links and Chdir | Excel Programming | |||
application.dialogs(xlDialogSaveAs) AND CHDIR | Excel Programming |