We are trying to log users that opens documents and we are using triggers "onOpen" trigger to call LogLogin Sub
however , client based qlikview also open in server runs this macro, but access point ( from web browser ) not working .
Also we tried to run this macro with button , same result..
Any Idea ?
Public Sub LogLogin
on error resume next
Dim DocName
Dim UserName
DocName=ActiveDocument.Name
set temp = ActiveDocument.GetApplication.GetProperties
UserName=temp.UserName
Dim mConnection
Set mConnection = CreateObject("ADODB.Connection")
mConnection.Open "xxxxxxxxxxxxx","xxxxxxxxxxx","xxxxxxxxxxxxxx"
Dim sql
sql="INSERT INTO xxxxxxxx (UserName,DocumentName) values ('" & UserName & "','" & DocName & "')"
mConnection.Execute sql
mConnection.close
Set mConnection = Nothing
if Err<>0 then
msgbox err
end if
end Sub