Excel 2000 - Path Problem

  • Thread starter Thread starter scain2004
  • Start date Start date
S

scain2004

This is the code I use now:

Private Sub Workbook_Open()
Dim fileName As String
Application.ScreenUpdating = False
jbl = ThisWorkbook.name

On Error Resume Next
Set wb = Workbooks(cwb)
On Error GoTo 0
If wb Is Nothing Then
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
Sheets("Admin").Range("CalName") = cwb
Set wb = Workbooks.Open(wbPath & cwb)
End If

Application.Workbooks(jbl).Activate
ThisWorkbook.Sheets("Phoenix").Activate
Application.ScreenUpdating = True
End Sub


I need to change this so when the first workbook opens, i
automatically uses the path in wbPath the next time the first workboo
opens when the Open dialog pops up.

Thanks,
Stev
 
Ok, that worked. Now, is there any way to validate wbPath for th
current computer. Say the path for the .xls file is stored in wbPat
on one computer at one location, if the saved value for wbPath does no
exist on the second computer, I need it to skip over the ChDrive an
ChDir statements (otherwise it will error out)
 
Ok, figured it out. I just saved the path information to the Registr
and pulled the info from there
 
Back
Top