×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

How to we know if how many times and how many users used our macro.. any help appreciated..

How to we know if how many times and how many users used our macro.. any help appreciated..

How to we know if how many times and how many users used our macro.. any help appreciated..

(OP)
Hello Everybody,
This is very nice platform to share and enhance our knowledge. Only because of this site I could speed up my work.
I came with a query that, when we create a macro, can we create some code such that we will get know that, how many times our macro has been used. I believe based on this we could calculate how many man hrs we saved... :) so that we could present our achievement to management.
Any help on this would really be appreciated..
I have just taken a portion of code from cklong (Automotive) (OP)'s post
Does anybody know how to modify this code to use as catia macro.. I'm really weak in programming sad
**************************
Dim path As String
Dim filename As String
Dim scrpt As String
Dim objFSO, objReadFile, contents
Dim ccontents As String
On Error Resume Next

path = "c:\temp\" 'location of file
filename = "test.txt" 'add text name
scrpt = "test" 'name of macro

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objReadFile = objFSO.OpenTextFile(path & filename, 1, False)

ccontents = objReadFile.ReadAll
If ccontents = "" Then
ccontents = 0
End If

ccontents = ccontents + 1
mut = Round(ccontents / 25)

If ccontents = 100 Then
MsgBox "You have use " & scrpt & " " & ccontents & "times you must really like this program."
ElseIf ccontents = 1 Then
MsgBox "Thank you for trying " & scrpt & " I hope you enjoy this program."
ElseIf ccontents = 25 * mut Then
MsgBox "You have use " & scrpt & " " & ccontents & "times. I think you owe me a coffee"
End If

Set Datos = CATIA.fileSystem.CreateFile(path & filename, True)

Set ostream = Datos.OpenAsTextStream("ForAppending")
ostream.Write ccontents & Chr(10)
ostream.Close

********************************

RE: How to we know if how many times and how many users used our macro.. any help appreciated..

(OP)
Thanks ferdo for your feedback on this. I have searched through this forum using keywards like log file and timestamp, but have not found any useful.
Can you please point out any example that could be useful for me?

Thanks you,

Rangrao Padiyar

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources