Excel 2000 - Path Problem

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
 
S

scain2004

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)
 
S

scain2004

Ok, figured it out. I just saved the path information to the Registr
and pulled the info from there
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top