Looking again at the original post, wouldn't it be just as easy for each user to
have a desktop shortcut to Excel with the workbook name in the command line?
"C:\Program Files\Microsoft Office\Exceldata\Joebook.xls"
Or you could place the shortcut in the user's Startup folder if you want Excel
to open with that workbook when user log in.
Gord Dibben MS Excel MVP
On Wed, 22 Aug 2007 19:09:47 -0400, "Otto Moehrbach" <(E-Mail Removed)>
wrote:
>Something like this might work for you. This is untested. Post back if
>this doesn't work for you. Place the following macro in the ThisWorkbook
>module. You would need to change ThePath to your real path, the user
>account names for Joe and Bill, and the names of the files you want opened.
>HTH Otto
>Private Sub Workbook_Open()
> Dim ThePath As String
> Dim FileName As String
> ThePath = "C:\TheFolder\TheSubFolder"
> If Environ("username") = "Joe" Then _
> FileName = "FileForJoe.xls"
> If Environ("username") = "Bill" Then _
> FileName = "FileForBill.xls"
> Workbooks.Open FileName:=ThePath & "\" & FileName
>End Sub
>
>"(E-Mail Removed)" <(E-Mail Removed)> wrote in
>message news:(E-Mail Removed)...
>> There are two userrs on the same computer. When user 1 opens Excel,
>> I'd like oen workbook to automatically open. When user2 opens Excel,
>> I'd like a diffferent workbook to automatically open. Is this
>> possible? (Each user logs into Windows usning their uuser account.)
>>
>> The computer is running windows XP pro and Excel 2007.
>>
>> Thanks,
>>
>
|