Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
Can I use the ActiveWorkbook.SaveAs function and include the user account to save the file as? For example, I want to save the file to a directory where the user running the macro only has read only access. This is why I want to specify the account to use (which has full access), to save the file successfully. i..e. ActiveWorkbook.SaveAs User: Domain\Name Password: xxxxxxx Is there a way this can be done? Thanks, Brett |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
If what you want is to merely determine who last edited the file, you
can examine the file properties for that. On Mon, 25 Jan 2010 04:06:02 -0800 (PST), TyreDude wrote: Hello, Can I use the ActiveWorkbook.SaveAs function and include the user account to save the file as? For example, I want to save the file to a directory where the user running the macro only has read only access. This is why I want to specify the account to use (which has full access), to save the file successfully. i..e. ActiveWorkbook.SaveAs User: Domain\Name Password: xxxxxxx Is there a way this can be done? Thanks, Brett |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 25, 7:06*am, TyreDude wrote:
Hello, Can I use the ActiveWorkbook.SaveAs function and include the user account to save the file as? For example, I want to save the file to a directory where the user running the macro only has read only access. This is why I want to specify the account to use (which has full access), to save the file successfully. i..e. ActiveWorkbook.SaveAs User: Domain\Name Password: xxxxxxx Is there a way this can be done? Thanks, Brett Security is based on the user that is signed onto the machine. Change permissions on the directory so the user can write to the directory, or re-assign the task to someone that has the necessary permissions. Goshute |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On 25 Jan, 12:58, goshute wrote:
On Jan 25, 7:06*am, TyreDude wrote: Hello, Can I use the ActiveWorkbook.SaveAs function and include the user account to save the file as? For example, I want to save the file to a directory where the user running the macro only has read only access. This is why I want to specify the account to use (which has full access), to save the file successfully. i..e. ActiveWorkbook.SaveAs User: Domain\Name Password: xxxxxxx Is there a way this can be done? Thanks, Brett Security is based on the user that is signed onto the machine. *Change permissions on the directory so the user can write to the directory, or re-assign the task to someone that has the necessary permissions. Goshute I need Excel to save the file as a different user (i.e. service account) who has permissions to write to the directory. I cannot re- assign the task to another user, it is not possible. I just want to know if Excel can save the file using a different user account. The user cannot write to the directory as I do not want them to change the file. |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jan 25, 8:57*am, TyreDude wrote:
On 25 Jan, 12:58, goshute wrote: On Jan 25, 7:06*am, TyreDude wrote: Hello, Can I use the ActiveWorkbook.SaveAs function and include the user account to save the file as? For example, I want to save the file to a directory where the user running the macro only has read only access. This is why I want to specify the account to use (which has full access), to save the file successfully. i..e. ActiveWorkbook.SaveAs User: Domain\Name Password: xxxxxxx Is there a way this can be done? Thanks, Brett Security is based on the user that is signed onto the machine. *Change permissions on the directory so the user can write to the directory, or re-assign the task to someone that has the necessary permissions. Goshute I need Excel to save the file as a different user (i.e. service account) who has permissions to write to the directory. *I cannot re- assign the task to another user, it is not possible. *I just want to know if Excel can save the file using a different user account. *The user cannot write to the directory as I do not want them to change the file.- Hide quoted text - - Show quoted text - I don't think Excel and VBA can do what you want. Permissions to the directorys are assigned by Windows when the user logs on to the pc not by the application. Even if more than one user is signed on to a single pc, each users permissions apply to that user. I can only guess that this functionality was left out of VBA because of virues and other malware. Goshute |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You could save to a temp location, then shell out to "runas" but it's not
the way to go. You'd have to store the account details in the workbook, and you have to use sendkeys to enter the password. Tim "goshute" wrote in message ... On Jan 25, 8:57 am, TyreDude wrote: On 25 Jan, 12:58, goshute wrote: On Jan 25, 7:06 am, TyreDude wrote: Hello, Can I use the ActiveWorkbook.SaveAs function and include the user account to save the file as? For example, I want to save the file to a directory where the user running the macro only has read only access. This is why I want to specify the account to use (which has full access), to save the file successfully. i..e. ActiveWorkbook.SaveAs User: Domain\Name Password: xxxxxxx Is there a way this can be done? Thanks, Brett Security is based on the user that is signed onto the machine. Change permissions on the directory so the user can write to the directory, or re-assign the task to someone that has the necessary permissions. Goshute I need Excel to save the file as a different user (i.e. service account) who has permissions to write to the directory. I cannot re- assign the task to another user, it is not possible. I just want to know if Excel can save the file using a different user account. The user cannot write to the directory as I do not want them to change the file.- Hide quoted text - - Show quoted text - I don't think Excel and VBA can do what you want. Permissions to the directorys are assigned by Windows when the user logs on to the pc not by the application. Even if more than one user is signed on to a single pc, each users permissions apply to that user. I can only guess that this functionality was left out of VBA because of virues and other malware. Goshute |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
....or netuse might be better, since you can just supply the password in the
commandline. Tim "Tim Williams" wrote in message ... You could save to a temp location, then shell out to "runas" but it's not the way to go. You'd have to store the account details in the workbook, and you have to use sendkeys to enter the password. Tim "goshute" wrote in message ... On Jan 25, 8:57 am, TyreDude wrote: On 25 Jan, 12:58, goshute wrote: On Jan 25, 7:06 am, TyreDude wrote: Hello, Can I use the ActiveWorkbook.SaveAs function and include the user account to save the file as? For example, I want to save the file to a directory where the user running the macro only has read only access. This is why I want to specify the account to use (which has full access), to save the file successfully. i..e. ActiveWorkbook.SaveAs User: Domain\Name Password: xxxxxxx Is there a way this can be done? Thanks, Brett Security is based on the user that is signed onto the machine. Change permissions on the directory so the user can write to the directory, or re-assign the task to someone that has the necessary permissions. Goshute I need Excel to save the file as a different user (i.e. service account) who has permissions to write to the directory. I cannot re- assign the task to another user, it is not possible. I just want to know if Excel can save the file using a different user account. The user cannot write to the directory as I do not want them to change the file.- Hide quoted text - - Show quoted text - I don't think Excel and VBA can do what you want. Permissions to the directorys are assigned by Windows when the user logs on to the pc not by the application. Even if more than one user is signed on to a single pc, each users permissions apply to that user. I can only guess that this functionality was left out of VBA because of virues and other malware. Goshute |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
saveas ActiveWorkbook.SaveAs Filename:=Range("A1").Value | Excel Programming | |||
ActiveWorkbook.SaveAs | Excel Programming | |||
Help with ActiveWorkbook.SaveAs | Excel Programming | |||
ActiveWorkbook.SaveAs | Excel Programming | |||
ActiveWorkbook.SaveAs - dealing with file already exists | Excel Programming |