4 replies
by simon.c.l Accepted solution
by slayer_ Accepted solution
You can append the users login name, or the computers name to the file name, heck even the creation time would work.
You can also have your code figure out which files already exist and increment to a new one each time, so if
File1 exists,
check file2
if file2 exists
check file3
if file3 does not exist
create it.
But your better off appending user names. User names are in an environment variable.
sString = vba.environ("USERNAME")
sString will contain the currenlty logged in users name. I may have got the function call wrong, check it in the context menus as you type it in.
So you could say
Dim iFile as integer
iFile=freefile
open "C:\file_" & vba.environ("USERNAME") & ".txt" for output as #iFile
This discussion is closed to new replies.
Trending Software posts
Sort by Trending