j844929
Active Member
- Joined
- Aug 18, 2002
- Messages
- 423
Hi,
I have some code that creates a versioned file name from data in an info form in a workbook and saves the file as that name.
I have referred to the filename as BookName in the code.
What I'm having a problem with is creating the code that searches the directory to see if the filename exists already. If it doesn't exist, then I'll run the code to save the workbook as the current version. If it does already exist, then the code should increment the version number and then save it. The kind of thing I have so far is:
If Dir("C:/ "BookName" ") <> "" Then
Call IncrementVersion
Else
Call SaveIt
End If
Instead of looking for a specified filename each time, I need it to look for what "BookName" is. Does anyone have an idea on how to do this?
Any help would be appreciated.
Tim
I have some code that creates a versioned file name from data in an info form in a workbook and saves the file as that name.
I have referred to the filename as BookName in the code.
What I'm having a problem with is creating the code that searches the directory to see if the filename exists already. If it doesn't exist, then I'll run the code to save the workbook as the current version. If it does already exist, then the code should increment the version number and then save it. The kind of thing I have so far is:
If Dir("C:/ "BookName" ") <> "" Then
Call IncrementVersion
Else
Call SaveIt
End If
Instead of looking for a specified filename each time, I need it to look for what "BookName" is. Does anyone have an idea on how to do this?
Any help would be appreciated.
Tim