|
-
Dec 8th, 2010, 10:48 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] Is there a way to determine who opened an Excel workbook?
We have Excel workbooks that are currently opened manually. When opened, SFTP download macros are automatically executed. We will be automating the opening of these workbooks via Windows scheduled tasks so that the downloads are done automatically each morning.
First, does anyone have any examples of job streams (MSDOS .bat files) that open Excel and Access and auto execute macros?
Second, is there a way to determine if the Excel workbook was opened manually by a user or opened via a scheduled .bat file task? It's important to know how the workbooks were opened.
Thanks.
-
Dec 8th, 2010, 02:36 PM
#2
Re: Is there a way to determine who opened an Excel workbook?
I don't think so, however while using a bat you are in control of who is opening. Just use the bat-file to create a value/setting etc to show it was open by the bat-file.
You're welcome to rate this post!
If your problem is solved, please use the Mark thread as resolved button
Wait, I'm too old to hurry!
-
Dec 8th, 2010, 03:35 PM
#3
Re: Is there a way to determine who opened an Excel workbook?
you can use the commandline arguments to pass some parameter when auto opening the file, so that you know it was not opened manually, you would need to use APIs to get the commandline
their is also a last author builtin document property, but i assume that will be the person previous to the current opening of the workbook
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Dec 8th, 2010, 08:20 PM
#4
Thread Starter
Hyperactive Member
Re: Is there a way to determine who opened an Excel workbook?
Thank you. I'll use GetCommandLine.
-
Dec 8th, 2010, 09:14 PM
#5
Re: [RESOLVED] Is there a way to determine who opened an Excel workbook?
the API getcommandline as string will just crash excel
see the last post in this thread for how to do it
http://www.vbforums.com/showthread.php?t=634313
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Dec 12th, 2010, 01:29 PM
#6
Thread Starter
Hyperactive Member
Re: [RESOLVED] Is there a way to determine who opened an Excel workbook?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|