Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>First, it appears that you are trying to log excel files opening using a service and excel.application object. This is not a very good solution, and you will find it gives inconsistent results at best. </p> <p>The Excel.Application object will be created within your application under the service account. This service may or may not be able to interact with the desktop, depending on your service settings. The user, however, will always be able to open the excel application within their user account.</p> <p>Second, if you are running the excel object service from the system account, you are opening yourself up for a huge security problem. Office documents are a huge source for all kinds of malware, and you will be giving anything opened under it a level of access to your system not even the administrator has. You should not be opening documents under a privileged account without considering the security ramifications.</p> <p>Third, many of the events in excel are specific to the gui, and if their is not a visible window, they may not fire. I learned this the hard way many years ago under 2000, and since then I have really limited my dependence on them.</p> <p>If I may make some recommendations, </p> <ul> <li>If your intent is to monitor who opens a file, consider using the file system security / logging built into windows. It can be set to audit a file and write to the security event log when the file is accessed. This information can easily be retrieved over the network with WMI.</li> <li>Do not run anything under a privileged account unless you are certain of what it will do. Your excel files may be fine right now, but one user bringing in a macro virus could be disastrous.</li> <li>If you must write your own "logging", consider using a global hook to monitor (monitor only, not change or modify) file opens by excel. A quickie hook application that only logs when an excel file is opened will not effect system performance, and will be much safer and more stable than what you are suggesting. If you are unfamiliar with hooks, desaware used to make some great components for hooking and subclassing and you should check them out. Unless you are very familiar with that the program is doing, though, only monitor the messages, don't attempt to "handle" them for excel.</li> <li>An Excel addin is just a file that adds custom functions or functionality to excel, it is most commonly VBA in an xll or xla file. If you need security, do not depend on an addin to monitor file access because they can easily be disabled.</li> </ul> <p>The most effective way to monitor who opens a file will be using file auditing that is built into NTFS.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload