Hello There!
I've a Vb.net Project that it is used to schedule, launch, and run a given macro of excel workbooks.
Here's the code:
If File1.Text <> "" Then
xlApp = New Excel.Application
xlworkbook = xlApp.Workbooks.Open(File1.Text, Local:=True)
xlApp.Visible = True
If mymacro1 <> "" Then
xlApp.Run(mymacro1)
End If
If mysave1 <> "" Then
fname = xlworkbook.Name
lpath = xlworkbook.Path & "\"
My.Computer.FileSystem.CopyFile(lpath & fname, mysave1 & fname, True)
End If
xlworkbook.Close()
End If
What I'd like to know is that if it is possible to create an audit/log for each action in vba.
Currently, i've set such log to excel worbook by using:
I'd like to know if it's possible to set the vb project to read and write to a txt/csv every action done by the excel macro.
Best Regards,
FC
What I have tried:
Currently, i've set such log to excel worbook by using:
Set mytxt = CreateObject("Scripting.FileSystemObject")
Set mylog = mytxt.createtextfile("Log_" & Now)
mylog.writeline Now & " | " &
But the intend is to create a button to enable/disable the creation of this log, without the need to code this into the excel macro.