Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set Excel Author Option?


I did a search on the forums to no avail...

Can you programmatically change the default Author setting for Excel?
I see you can return it, but I can't see how to set it!

I am running an Access database which allows users to export data to
Excel. When they do this, however, I want their username to be the
Author attribute of the documents that they create. How can I do this?
I can set the attribute for an individual workbook, but I want to
change it in their Excel options.

Thanks!!


--
tkstock


------------------------------------------------------------------------
tkstock's Profile: http://www.excelforum.com/member.php...o&userid=14443
View this thread: http://www.excelforum.com/showthread...hreadid=379129

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set Excel Author Option?


Good evening Tom

Try going to Tools Options, General tab, Username.

This is the name that Excel uses as the author in the file properties.

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=379129

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set Excel Author Option?


I appreciate your post, however, I am looking to do thi
programatically. I know how to do this manually

--
tkstoc

-----------------------------------------------------------------------
tkstock's Profile: http://www.excelforum.com/member.php...fo&userid=1444
View this thread: http://www.excelforum.com/showthread.php?threadid=37912

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set Excel Author Option?


Hi Tom

I answered the question that you asked using the information you
supplied. In the light of what you've just posted, this might help.

Sub Test()
Application.UserName = "DominicB"
End Sub

HTH

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=379129

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set Excel Author Option?


dominicb Wrote:
I answered the question that you asked using the information you
supplied.


I guess you missed the part where I stated

Can you programmatically change the default Author setting for Excel? I
see you can return it, but I can't see how to set it!


I felt it was pretty clear, but I could be mistaken.


--
tkstock


------------------------------------------------------------------------
tkstock's Profile: http://www.excelforum.com/member.php...o&userid=14443
View this thread: http://www.excelforum.com/showthread...hreadid=379129



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set Excel Author Option?


BTW, your code does what I was looking for it to do.

Thanks for your help

--
tkstoc

-----------------------------------------------------------------------
tkstock's Profile: http://www.excelforum.com/member.php...fo&userid=1444
View this thread: http://www.excelforum.com/showthread.php?threadid=37912

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set Excel Author Option?


You're welcome.

Dominic

--
dominic
-----------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...fo&userid=1893
View this thread: http://www.excelforum.com/showthread.php?threadid=37912

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set Excel Author Option?


Ultimately, the purpose of this exercise was for an Access database. I
some cases I instantiate XL spreadsheets on the fly - I wanted to se
the author to be the database and username. This works fine if th
spreadsheet is created in code using the XL object.

However, if I use an Access function like this:


Code
-------------------
DoCmd.OutputTo acOutputQuery, "qry_MyQuery", acFormatXLS, , Tru
-------------------


the author attribute is NOT set (as a matter of fact, it is blank!).
This is my current problem.

More Info: What I am currently doing is this: when the user logs int
the database, I grab the current value of Excel.Application.Username.
Then, anytime I create a spreadsheet, I change the E.A.Username t
"MyDatabase(user)", then I create and save the spreadsheet, then
change it back to the orginal value. The only time this doesn't wor
is if I use the Access function described above.

Any thoughts

--
tkstoc

-----------------------------------------------------------------------
tkstock's Profile: http://www.excelforum.com/member.php...fo&userid=1444
View this thread: http://www.excelforum.com/showthread.php?threadid=37912

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Set Excel Author Option?


Hi Tom

Unfortunately not. According to Excel's help files the only way to
access the author name is to use theBuiltInDocumentProperties structure
thus:

Sub Test()
a = ActiveWorkbook.BuiltinDocumentProperties("Author") .Value
MsgBox a
End Sub

which is a read-only setting and hence no good to you. Although using
legitimate instructions, XL doesn't seem to like communicating all file
properties to Access. Stumped!

Sorry I cannot be of any further help.

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile: http://www.excelforum.com/member.php...o&userid=18932
View this thread: http://www.excelforum.com/showthread...hreadid=379129

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Set Excel Author Option?

which is a read-only setting and hence no good to you.

It is not a read-only setting. You can set the 'Author' property
with code:

ThisWorkbook.BuiltinDocumentProperties("Author").V alue = _
"New Author Name"
MsgBox ThisWorkbook.BuiltinDocumentProperties("Author").V alue



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"dominicb"
wrote in message
...

Hi Tom

Unfortunately not. According to Excel's help files the only
way to
access the author name is to use theBuiltInDocumentProperties
structure
thus:

Sub Test()
a = ActiveWorkbook.BuiltinDocumentProperties("Author") .Value
MsgBox a
End Sub

which is a read-only setting and hence no good to you.
Although using
legitimate instructions, XL doesn't seem to like communicating
all file
properties to Access. Stumped!

Sorry I cannot be of any further help.

DominicB


--
dominicb
------------------------------------------------------------------------
dominicb's Profile:
http://www.excelforum.com/member.php...o&userid=18932
View this thread:
http://www.excelforum.com/showthread...hreadid=379129



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel author name Jim Lynch Excel Discussion (Misc queries) 6 March 29th 10 04:40 PM
want to see excel author name tab PaTina Excel Discussion (Misc queries) 1 March 2nd 10 08:00 PM
Add author in Excel 2007 lglenn Excel Discussion (Misc queries) 1 January 3rd 10 11:21 PM
Is there an author field in Excel? Gord Dibben Excel Discussion (Misc queries) 1 March 19th 09 09:49 PM
Is there an author field in Excel? Gord Dibben Excel Discussion (Misc queries) 0 March 18th 09 03:22 PM


All times are GMT +1. The time now is 12:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"