Results 1 to 6 of 6

Thread: [RESOLVED] Is there a way to determine who opened an Excel workbook?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Resolved [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.

  2. #2
    I don't do your homework! opus's Avatar
    Join Date
    Jun 2000
    Location
    Good Old Europe
    Posts
    3,863

    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!

  3. #3
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Re: Is there a way to determine who opened an Excel workbook?

    Thank you. I'll use GetCommandLine.

  5. #5
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    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

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2002
    Posts
    382

    Re: [RESOLVED] Is there a way to determine who opened an Excel workbook?

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width