OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

cell automatically shows Windows username? possible?

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
dummydecoy
General User
General User


Joined: 06 Oct 2010
Posts: 39

PostPosted: Mon May 14, 2012 7:49 am    Post subject: cell automatically shows Windows username? possible? Reply with quote

Is it possible for calc to automatically have A1 show the Windows username?
basically the path, C:\Documents and Settings\JohnSmith

where A1 will automatically show JohnSmith?

If so, how?

I searched and found this:
http://www.oooforum.org/forum/viewtopic.phtml?t=149563

But I don't even know what to do about it. Very Happy
Back to top
View user's profile Send private message
ozzie
OOo Advocate
OOo Advocate


Joined: 29 Jul 2010
Posts: 400
Location: victoria

PostPosted: Mon May 14, 2012 8:09 pm    Post subject: Reply with quote

Code:
=MID(CELL("filename");FIND("Users";CELL("filename"))+6;FIND("/";CELL("filename");FIND("Users";CELL("filename"))+6)-(FIND("Users";CELL("filename"))+6))

I don't know macros but this in cell A1 should do what you want providing the user name is the next directory after Users.
In my PC the filename looks like this-
'file:///C:/Users/Name/Documents/SomeFile.ods'#$Sheet3
_________________
If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button).
Back to top
View user's profile Send private message
dummydecoy
General User
General User


Joined: 06 Oct 2010
Posts: 39

PostPosted: Sat May 19, 2012 5:14 pm    Post subject: Reply with quote

Aww, on my PC the username is after "Documents and Settings".
for example, C:\Documents and Settings\JohnSmith\My Documents\...
So John Smith is what I need to show up on A1.
Can your code be modified to do that? I know very little of spreadsheets (
Back to top
View user's profile Send private message
ozzie
OOo Advocate
OOo Advocate


Joined: 29 Jul 2010
Posts: 400
Location: victoria

PostPosted: Sat May 19, 2012 6:11 pm    Post subject: Reply with quote

Hi dummydecoy
No problems it can be done but your path looks wrong
Copy / paste this formula into a cell of a saved file (ie not an unsaved untitled1 blank spreadsheet) and copy the path name so I can see it.
Change the user & filenames (like I have) if you wish but don't change anything else
Code:
=CELL("filename")

_________________
If your problem has been solved please add "[Solved]" to the beginning of your first post title (edit button).
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group