Writing / reading to the Windows event log

Is there an easy way to write and read from the Windows event log in VBA?

+6
api vba event-log
source share
1 answer

Yes, using standard API calls. See HOWTO: Windows NT Event Logging from Visual Basic. This is pretty old, but you should start.

Please note, however, that this code uses the default source. (Run the event log to see what I mean by source.) I did not run tihs code in Access, so I don’t know what the default source for Access is used for. In VB6 thuogh, this was something in common with VB 6 runtime or some. If you visited the ReportEvent and MessageDLL parameters thread, it says that you need to run the installation program with administrator rights to add the name and path to your application HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Eventlog \ Application \ Thus, this may become more complicated when it comes to getting a distinguishable source in the event log.

+3
source share

All Articles