User-Specific document-type stuff

C

CrankyLemming

Seems like every week I'm back with a new question. I'm beginning to
think I should have just posted a detailed account of what I want and
let you guys get on with it.

Anyway, I think I have good cause to be stuck now. :)

I have a main workbook ("Main") which the whole office can access, and
it operates on being userform driven - there's no actual spreadsheet
onscreen at any time. What I want to do is include a button on the
userform which opens a specific worksheet, dependant on the user's
name.

Everyone had a single-sheet workbook with their name as the workbook
name: Alan.xls, Barry.xls, Chris.xls, Dave.xls, etc, where they record
their working hours.

"Main" already contains a macro that looks for the UserName when
opened, so I've tried the following:

ActiveWorkbook.FollowHyperlink Address:=("\\Department
Name\Benefits\alan\4\" & UserName), NewWindow:=True

.... but this throws back an error.

Am I missing something really obvious?

TIA, as usual

Alan
 
J

JulieD

Hi

have you solved this one yet? if not, here's a suggestion that might work
Workbooks.Open Filename:=("\\Department Name\Benefits\alan\4\" & UserName
&".xls")

Cheers
JulieD
 
C

CrankyLemming

JulieD said:
have you solved this one yet?

Nope. Bah.
if not, here's a suggestion that might work
Workbooks.Open Filename:=("\\Department Name\Benefits\alan\4\" & UserName
&".xls")

Julie

Thanks for the suggestion. certainly the change to open.filename is
better. When I run this, though,Excel tries to open a document called:
"\\Department Name\Benefits\alan\4\.xls", so it ignores the "&
UserName &" element.

I've managed to get it to open by having a cell contain the full
location of the file and the using the Worksheets/activate and
range/select, and Worksheets Open.Filename:=(ActiveCell.Value), which
is great, but now it won't let me open in a new window
(",NewWindow:=True").

Any ideas?

Thanks again

S:)
 
Top