ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Mac issue with macro recording user login & date (run time error ' (https://www.excelbanter.com/excel-programming/335930-mac-issue-macro-recording-user-login-date-run-time-error.html)

Linking to specific cells in pivot table

Mac issue with macro recording user login & date (run time error '
 
Hi,

Based on feedback from a post I entered early this week, I used the code
below (entered in the "General Declarations" section of the "This Workbook"
sheet) to record the user ID and date of when a spreadsheet is opened. The
issue is the person using this spreadsheet has a Mac and said they are
getting the following error when opening the spreadsheet: "run time error
'5'".

He said that the error apparently is stopping the userid from being recorded
(the date is populating OK). Any help on how to get around this is
appreciated! - Robert

Private Sub Workbook_Open()

Dim rng As Range

Set rng = Sheets("Proj.Mngt.").Range("I45").End(xlUp).Offset (1, 0)

rng.Value = Now()
rng.Offset(0, 1) = Environ("UserName")

End Sub

[email protected]

Mac issue with macro recording user login & date (run time error '
 
Environ method not available on Macs. Would Application.UserName in
place of Environ("UserName") do?


Linking to specific cells in pivot table

Mac issue with macro recording user login & date (run time err
 
Thanks!! One more question -- how do I change the 'Application.Username'
value?

Thanks,

Robert

" wrote:

Environ method not available on Macs. Would Application.UserName in
place of Environ("UserName") do?



JE McGimpsey

Mac issue with macro recording user login & date (run time err
 
Did you try setting the property?

Application.Username = "whatever"

In article ,
"Linking to specific cells in pivot table"
crosoft.com wrote:

Thanks!! One more question -- how do I change the 'Application.Username'
value?


NickHK

Mac issue with macro recording user login & date (run time err
 
Robert,
Application.Username is Read/Write.
However, it is an Office wide property, so Word, Access etc will pick up the
change.

NickHK

"Linking to specific cells in pivot table"
crosoft.com wrote in
message ...
Thanks!! One more question -- how do I change the 'Application.Username'
value?

Thanks,

Robert

" wrote:

Environ method not available on Macs. Would Application.UserName in
place of Environ("UserName") do?





Steve

Mac issue with macro recording user login & date (run time err
 
If you are looking to change it on individual computers, look in Tools,
Options and I believe General tab.

"JE McGimpsey" wrote:

Did you try setting the property?

Application.Username = "whatever"

In article ,
"Linking to specific cells in pivot table"
crosoft.com wrote:

Thanks!! One more question -- how do I change the 'Application.Username'
value?




All times are GMT +1. The time now is 08:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com